Compare commits

...

24 Commits

Author SHA1 Message Date
camjac251
27e0736869 Revert "Building with AppVeyor"
This reverts commit cbc1afb497.
2015-11-02 19:37:11 -06:00
camjac251
cbc1afb497 Building with AppVeyor 2015-11-02 19:18:21 -06:00
flightlevel
e453e3924e Merge pull request #18 from raspdealer/patch-2
Add alt tag in index.html
2015-11-02 20:15:38 +11:00
Raspdealer
e3e7cf4a21 Update index.html
I've got a loading issue yesterday and noticed that this alt tag was missing. Trivial but good for accessibility.
2015-11-02 09:52:44 +01:00
flightlevel
1e17510bcd Merge pull request #17 from raspdealer/patch-1
Update README.md
2015-11-02 19:40:15 +11:00
Raspdealer
5a8fae4b14 Update README.md
There was a mistake on Ubuntu 15.x installation guide link
2015-11-02 09:35:18 +01:00
flightlevel
9c3f76def2 Merge pull request #16 from Jackett/flightlevel-patch-1
Add Ubuntu install instructions
2015-11-02 19:23:22 +11:00
flightlevel
12321eebdd Add Ubuntu install instructions
Add links to HTPC guides
2015-11-02 19:22:29 +11:00
flightlevel
9ef75f8963 Merge pull request #7 from flightlevel/master
MoreThanTV Decode Response
2015-10-30 20:12:19 +11:00
flightlevel
3a0d814903 MoreThanTV Decode Response
MoreThanTV Decode Response to fix issue
https://github.com/zone117x/Jackett/issues/235
2015-10-30 20:10:15 +11:00
WhatFox
058c12175d Update torrentday url 2015-10-29 20:22:47 +00:00
WhatFox
62fdd46c85 Update README.md 2015-10-29 20:07:11 +00:00
What Fox
f8dad55c22 Merge pull request #1 from Inrego/master
Bug fixes, new tracker
2015-10-29 17:27:02 +00:00
René Simonsen
83717cc220 Fixed bug in pagination on NextGen 2015-10-26 21:06:07 +01:00
René Simonsen
09d00eba32 Pagination on NxtGn
I've added support for offset and limit parameters on the NextGen
tracker
2015-10-26 20:48:04 +01:00
René Simonsen
c07fc4de44 Fixes some invalid torrent files
Sonarr would not accept torrents where the keys were not sorted. This
update will sort the keys before sending the file to the downloader to
make the torrent valid for Sonarr.
2015-10-26 20:13:09 +01:00
René Simonsen
ea6f65e725 NextGen url change 2015-10-26 10:20:58 +01:00
René Simonsen
4392219158 Changed download urls
I changed the download urls, because the current way with segments
(having the parameters between slashes) was causing problems with long
encoded urls, since a segment can be no longer than 255 characters. It
was changed to use regular url parameters which have no such limit on
length.
2015-10-26 10:20:14 +01:00
René Simonsen
e56875f1a3 Added new danish tracker: DanishBits
Added a new closed tracker from Denmark. It's easier to get into than
NextGen, and is a good backup for missing episodes on NextGen.
2015-10-24 16:54:32 +02:00
René Simonsen
87b3f7e108 Changed NextGen to completed
NextGen has been tested now, changed to completed.
2015-10-24 16:53:37 +02:00
René Simonsen
97bf0e50b0 Added e-book and audiobook categories 2015-10-23 20:24:05 +02:00
René Simonsen
10e81d15d2 NextGen danish only continued
Additions to the change from last commit that was forgotten before.
2015-10-23 20:04:08 +02:00
René Simonsen
4552e7c1dc Option for only danish categories to NextGen
Added an option to the config of NextGen, so that it only returns
categories with danish content (DK subs or voice).
2015-10-23 19:56:44 +02:00
KZ
d6cabc0c2d Terrabad at english 2015-10-15 22:12:03 +01:00
15 changed files with 467 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
## Jackett
This project is currently in hibernation and is unmaintained, feel free to fork and continue devleopment.
This project is a new fork and is recruiting development help. If you are able to help out please contact us.
#### Overview
This software creates a [Torznab](https://github.com/Sonarr/Sonarr/wiki/Implementing-a-Torznab-indexer) (with [nZEDb](https://github.com/nZEDb/nZEDb/blob/master/docs/newznab_api_specification.txt) category numbering) and [TorrentPotato](https://github.com/RuudBurger/CouchPotatoServer/wiki/Couchpotato-torrent-provider) API server on your machine. Torznab enables software such as [Sonarr](https://sonarr.tv) to access data from your favorite indexers in a similar fashion to rss but with added features such as searching. TorrentPotato is an interface accessible to [CouchPotato](https://couchpota.to/).
@@ -58,8 +58,6 @@ We were previously focused on TV but are working on extending searches to allow
#### Installation on Windows
Grab the latest release from the [website](http://jackett.net/Download).
We recommend you install Jackett as a Windows service using the supplied installer. When installed as a service the tray icon acts as a way to open/start/stop Jackett. If you opted to not install it as a service then Jackett will run its web server from the tray tool.
Jackett can also be run from the command line using JackettConsole.exe if you would like to see log messages (Ensure the server isn't already running from the tray/service).
@@ -70,7 +68,9 @@ Jackett can also be run from the command line using JackettConsole.exe if you wo
* Debian/Ubunutu: apt-get install libcurl-dev
* Redhat/Fedora: yum install libcurl-devel
* For other distros see the [Curl docs](http://curl.haxx.se/dlwiz/?type=devel).
3. Download and extract the latest ```.tar.bz2``` release from the [website](http://jackett.net/Download) and run Jackett using mono with the command "mono JackettConsole.exe".
3. Download and extract the latest ```.tar.bz2``` release from the [releases page](https://github.com/Jackett/Jackett/releases) and run Jackett using mono with the command "mono JackettConsole.exe".
Detailed instructions for [Ubuntu 14.x](http://www.htpcguides.com/install-jackett-on-ubuntu-14-x-for-custom-torrents-in-sonarr/) and [Ubuntu 15.x](http://www.htpcguides.com/install-jackett-ubuntu-15-x-for-custom-torrents-in-sonarr/)
#### Installation on Synology
1. Install Sonarr & Mono 3.10 from synocommunity.
@@ -95,13 +95,10 @@ Try running with the "--SSLFix true" if you are on Redhat/Fedora/NNS based libcu
You can get additional logging with the switches "-t -l". Please post logs if you are unable to resolve your issue with these switches ensuring to remove your username/password/cookies.
### Contributing
All contributions are welcome just send a pull request. Jackett's framework allows our team (and any other volunteering dev) to implement new trackers in an hour or two. If you'd like support for a new tracker but are not a developer then feel free to leave a request on the [issues page](https://github.com/zone117x/Jackett/issues). It is recommended to use Visual studio 2015 when making code changes in this project.
### Contact & Support
Use the github issues pages or talk to us directly at: [irc.freenode.net#jackett](http://webchat.freenode.net/?channels=#jackett).
### Screenshots
![screenshot](http://i.imgur.com/t1sVva6.png "screenshot")
![screenshot](http://i.imgur.com/t1sVva6.png "screenshot")

View File

@@ -24,7 +24,7 @@
<body>
<div id="page">
<img id="logo" src="/jacket_medium.png" /><span id="header-title">Jackett</span>
<img id="logo" src="/jacket_medium.png" alt="Logo" /><span id="header-title">Jackett</span>
<div class="pull-right jackett-apikey">
<span class="input-header">API Key: </span>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@@ -425,7 +425,7 @@ namespace Jackett.Controllers
foreach (var result in results)
{
var link = result.Link;
result.Link = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId);
result.Link = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "dl", result.Title + ".torrent");
if (result.Link != null && result.Link.Scheme != "magnet" && !string.IsNullOrWhiteSpace(Engine.Server.Config.BlackholeDir))
result.BlackholeLink = serverService.ConvertToProxyLink(link, serverUrl, result.TrackerId, "bh", string.Empty);

View File

@@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using MonoTorrent.BEncoding;
namespace Jackett.Controllers
{
@@ -29,7 +30,7 @@ namespace Jackett.Controllers
}
[HttpGet]
public async Task<HttpResponseMessage> Download(string indexerID, string path, string apikey)
public async Task<HttpResponseMessage> Download(string indexerID, string path, string apikey, string file)
{
try
{
@@ -51,9 +52,17 @@ namespace Jackett.Controllers
var downloadBytes = await indexer.Download(target);
// This will fix torrents where the keys are not sorted, and thereby not supported by Sonarr.
var torrentDictionary = BEncodedDictionary.DecodeTorrent(downloadBytes);
downloadBytes = torrentDictionary.Encode();
var result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new ByteArrayContent(downloadBytes);
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-bittorrent");
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
{
FileName = file
};
return result;
}
catch (Exception e)

View File

@@ -126,7 +126,7 @@ namespace Jackett.Controllers
foreach (var r in releases)
{
var release = Mapper.Map<ReleaseInfo>(r);
release.Link = serverService.ConvertToProxyLink(release.Link, serverUrl, indexerID);
release.Link = serverService.ConvertToProxyLink(release.Link, serverUrl, indexerID, "dl", release.Title + ".torrent");
// Only accept torrent links, magnet is not supported
if (release.Link != null)

View File

@@ -116,7 +116,7 @@ namespace Jackett.Controllers
foreach(var result in releases)
{
var clone = Mapper.Map<ReleaseInfo>(result);
clone.Link = serverService.ConvertToProxyLink(clone.Link, serverUrl, indexerID);
clone.Link = serverService.ConvertToProxyLink(clone.Link, serverUrl, indexerID, "dl", result.Title + ".torrent");
resultPage.Releases.Add(clone);
}

View File

@@ -0,0 +1,291 @@
using CsQuery;
using Jackett.Indexers;
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.Globalization;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI.WebControls;
using CsQuery.ExtensionMethods;
using Jackett.Models.IndexerConfig;
namespace Jackett.Indexers
{
public class DanishBits : BaseIndexer, IIndexer
{
private string LoginUrl { get { return SiteLink + "login.php"; } }
private string SearchUrl { get { return SiteLink + "torrents.php"; } }
new NxtGnConfigurationData configData
{
get { return (NxtGnConfigurationData)base.configData; }
set { base.configData = value; }
}
public DanishBits(IIndexerManagerService i, Logger l, IWebClient c, IProtectionService ps)
: base(name: "DanishBits",
description: "A danish closed torrent tracker",
link: "https://danishbits.org/",
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
manager: i,
client: c,
logger: l,
p: ps,
configData: new NxtGnConfigurationData())
{
// Movies Mapping
// DanishBits HD
AddCategoryMapping(2, TorznabCatType.MoviesHD);
AddCategoryMapping(2, TorznabCatType.MoviesWEBDL);
// Danske film
AddCategoryMapping(3, TorznabCatType.MoviesHD);
AddCategoryMapping(3, TorznabCatType.MoviesWEBDL);
AddCategoryMapping(3, TorznabCatType.MoviesDVD);
AddCategoryMapping(3, TorznabCatType.MoviesForeign);
AddCategoryMapping(3, TorznabCatType.MoviesSD);
// DVDR Nordic
AddCategoryMapping(10, TorznabCatType.MoviesDVD);
AddCategoryMapping(10, TorznabCatType.MoviesForeign);
// Custom
AddCategoryMapping(28, TorznabCatType.MoviesHD);
AddCategoryMapping(28, TorznabCatType.MoviesDVD);
// Custom HD
AddCategoryMapping(29, TorznabCatType.MoviesHD);
AddCategoryMapping(29, TorznabCatType.MoviesWEBDL);
// Custom Tablet
AddCategoryMapping(31, TorznabCatType.MoviesSD);
if (!configData.OnlyDanishCategories.Value)
{
// Bluray
AddCategoryMapping(8, TorznabCatType.MoviesBluRay);
// Boxset
AddCategoryMapping(9, TorznabCatType.MoviesHD);
AddCategoryMapping(9, TorznabCatType.MoviesForeign);
AddCategoryMapping(9, TorznabCatType.MoviesDVD);
// DVDR
AddCategoryMapping(11, TorznabCatType.MoviesDVD);
// HDx264
AddCategoryMapping(22, TorznabCatType.MoviesHD);
// XviD/MP4/SDx264
AddCategoryMapping(24, TorznabCatType.MoviesSD);
}
// TV Mapping
// DanishBits TV
AddCategoryMapping(1, TorznabCatType.TVHD);
AddCategoryMapping(1, TorznabCatType.TVWEBDL);
// Dansk TV
AddCategoryMapping(4, TorznabCatType.TVHD);
AddCategoryMapping(4, TorznabCatType.TVWEBDL);
AddCategoryMapping(4, TorznabCatType.TVFOREIGN);
AddCategoryMapping(4, TorznabCatType.TVSD);
// Custom TV
AddCategoryMapping(30, TorznabCatType.TVHD);
AddCategoryMapping(30, TorznabCatType.TVWEBDL);
if (!configData.OnlyDanishCategories.Value)
{
// TV
AddCategoryMapping(20, TorznabCatType.TVHD);
AddCategoryMapping(20, TorznabCatType.TVSD);
AddCategoryMapping(20, TorznabCatType.TVWEBDL);
// TV Boxset
AddCategoryMapping(21, TorznabCatType.TVHD);
AddCategoryMapping(21, TorznabCatType.TVSD);
AddCategoryMapping(21, TorznabCatType.TVWEBDL);
}
// E-book
AddCategoryMapping(12, TorznabCatType.BooksEbook);
// Audiobooks
AddCategoryMapping(6, TorznabCatType.AudioAudiobook);
}
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
{
configData.LoadValuesFromJson(configJson);
var pairs = new Dictionary<string, string> {
{ "username", configData.Username.Value },
{ "password", configData.Password.Value },
{ "langlang", null },
{ "login", "login" }
};
// Get inital cookies
CookieHeader = string.Empty;
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl);
await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("logout.php"), () =>
{
CQ dom = response.Content;
var messageEl = dom["#loginform .warning"];
var errorMessage = messageEl.Text().Trim();
throw new ExceptionWithConfigData(errorMessage, configData);
});
return IndexerConfigurationStatus.RequiresTesting;
}
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
var releasesPerPage = 100;
var releases = new List<ReleaseInfo>();
var page = (query.Offset/releasesPerPage) + 1;
string episodeSearchUrl;
if (string.IsNullOrEmpty(query.GetQueryString()))
{
episodeSearchUrl = SearchUrl + "?page=" + page;
}
else
{
var cats = MapTorznabCapsToTrackers(query);
var catsUrlPart = string.Join("&", cats.Select(c => $"filter_{c}=on"));
episodeSearchUrl = $"{SearchUrl}?page={page}&group=0&{catsUrlPart}&search={HttpUtility.UrlEncode(query.GetQueryString())}&pre_type=torrents&type=";
}
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
if (string.IsNullOrEmpty(results.Content))
{
CookieHeader = string.Empty;
var pairs = new Dictionary<string, string>
{
{"username", configData.Username.Value},
{"password", configData.Password.Value},
{"langlang", null},
{"login", "login"}
};
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, CookieHeader, true, null, LoginUrl);
await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("logout.php"), () =>
{
CQ dom = response.Content;
var messageEl = dom["#loginform .warning"];
var errorMessage = messageEl.Text().Trim();
throw new ExceptionWithConfigData(errorMessage, configData);
});
results = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
}
try
{
CQ dom = results.Content;
var rows = dom["#torrent_table tr.torrent"];
foreach (var row in rows)
{
var qRow = row.Cq();
var release = new ReleaseInfo
{
MinimumRatio = 1,
MinimumSeedTime = 172800
};
var catAnchor = row.FirstChild.FirstChild;
var catUrl = catAnchor.GetAttribute("href");
var catStr = Regex.Match(catUrl, "filter_(?<catNo>[0-9]+)=on").Groups["catNo"].Value;
var catNo = int.Parse(catStr);
var moviesCatsDanish = new[] { 2,3,10,28,29,31 };
var moviesCatsIntl = new[] { 8,9,11,22,24 };
var moviesCats = configData.OnlyDanishCategories.Value
? moviesCatsDanish
: moviesCatsDanish.Concat(moviesCatsIntl);
var seriesCatsDanish = new[] { 1,4,30 };
var seriesCatsIntl = new[] { 20,21 };
var seriesCats = configData.OnlyDanishCategories.Value
? seriesCatsDanish
: seriesCatsDanish.Concat(seriesCatsIntl);
if (moviesCats.Contains(catNo))
release.Category = TorznabCatType.Movies.ID;
else if (seriesCats.Contains(catNo))
release.Category = TorznabCatType.TV.ID;
else if (catNo == 12)
release.Category = TorznabCatType.BooksEbook.ID;
else if (catNo == 6)
release.Category = TorznabCatType.AudioAudiobook.ID;
else
continue;
var titleAnchor = qRow.Find("div.croptorrenttext a").FirstElement();
var title = titleAnchor.GetAttribute("title");
release.Title = title;
var dlUrlAnchor = qRow.Find("span.right a").FirstElement();
var dlUrl = dlUrlAnchor.GetAttribute("href");
var authkey = Regex.Match(dlUrl, "authkey=(?<authkey>[0-9a-zA-Z]+)").Groups["authkey"].Value;
var torrentPass = Regex.Match(dlUrl, "torrent_pass=(?<torrent_pass>[0-9a-zA-Z]+)").Groups["torrent_pass"].Value;
var torrentId = Regex.Match(dlUrl, "id=(?<id>[0-9]+)").Groups["id"].Value;
release.Link = new Uri($"{SearchUrl}/{title}.torrent/?action=download&authkey={authkey}&torrent_pass={torrentPass}&id={torrentId}");
var torrentLink = titleAnchor.GetAttribute("href");
release.Guid = new Uri(SiteLink + torrentLink);
release.Comments = new Uri(SearchUrl + torrentLink);
var addedElement = qRow.Find("span.time").FirstElement();
var addedStr = addedElement.GetAttribute("title");
release.PublishDate = DateTime.ParseExact(addedStr, "MMM dd yyyy, HH:mm",
CultureInfo.InvariantCulture);
var columns = qRow.Children();
var seedersElement = columns.Reverse().Skip(1).First();
release.Seeders = int.Parse(seedersElement.InnerText);
var leechersElement = columns.Last().FirstElement();
release.Peers = release.Seeders + int.Parse(leechersElement.InnerText);
var sizeElement = columns.Skip(2).First();
var sizeStr = sizeElement.InnerText;
release.Size = ReleaseInfo.GetBytes(sizeStr);
var imdbAnchor = qRow.Find(".torrentnotes a")
.FirstOrDefault(a => a.GetAttribute("href").Contains("imdb.com"));
if (imdbAnchor != null)
{
var referrerUrl = imdbAnchor.GetAttribute("href");
release.Imdb = long.Parse(Regex.Match(referrerUrl, "tt(?<imdbId>[0-9]+)").Groups["imdbId"].Value);
}
releases.Add(release);
}
}
catch (Exception ex)
{
OnParseError(results.Content, ex);
}
return releases;
}
public class NxtGnConfigurationData : ConfigurationData
{
public NxtGnConfigurationData()
{
Username = new StringItem { Name = "Username" };
Password = new StringItem { Name = "Password" };
OnlyDanishCategories = new BoolItem { Name = "Only Danish Categories" };
}
public StringItem Username { get; private set; }
public StringItem Password { get; private set; }
public BoolItem OnlyDanishCategories { get; private set; }
}
}
}

View File

@@ -100,7 +100,8 @@ namespace Jackett.Indexers
try
{
var json = JObject.Parse(response.Content);
string decodedResponse = WebUtility.HtmlDecode(response.Content);
var json = JObject.Parse(decodedResponse);
foreach (JObject r in json["response"]["results"])
{
DateTime pubDate = DateTime.MinValue;

View File

@@ -17,6 +17,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI.WebControls;
using CsQuery.ExtensionMethods;
using Jackett.Models.IndexerConfig;
namespace Jackett.Indexers
@@ -27,65 +28,78 @@ namespace Jackett.Indexers
private string SearchUrl { get { return SiteLink + "browse.php"; } }
private string ProfileUrl { get { return SiteLink + "my.php"; } }
new ConfigurationDataBasicLoginWithRSS configData
new NxtGnConfigurationData configData
{
get { return (ConfigurationDataBasicLoginWithRSS)base.configData; }
get { return (NxtGnConfigurationData)base.configData; }
set { base.configData = value; }
}
public NxtGn(IIndexerManagerService i, Logger l, IWebClient c, IProtectionService ps)
: base(name: "NextGen",
description: "A danish closed torrent tracker",
link: "https://nxtgn.info/",
link: "https://nxtgn.biz/",
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
manager: i,
client: c,
logger: l,
p: ps,
configData: new ConfigurationDataBasicLoginWithRSS())
configData: new NxtGnConfigurationData())
{
//Movies Mapping
AddCategoryMapping(9, TorznabCatType.MoviesHD);
AddCategoryMapping(9, TorznabCatType.Movies);
AddCategoryMapping(9, TorznabCatType.MoviesBluRay);
AddCategoryMapping(47, TorznabCatType.Movies3D);
AddCategoryMapping(38, TorznabCatType.MoviesHD);
AddCategoryMapping(38, TorznabCatType.MoviesWEBDL);
AddCategoryMapping(38, TorznabCatType.MoviesBluRay);
AddCategoryMapping(5, TorznabCatType.MoviesSD);
AddCategoryMapping(23, TorznabCatType.MoviesForeign);
AddCategoryMapping(22, TorznabCatType.MoviesSD);
AddCategoryMapping(33, TorznabCatType.MoviesHD);
AddCategoryMapping(33, TorznabCatType.Movies);
AddCategoryMapping(17, TorznabCatType.MoviesForeign);
AddCategoryMapping(17, TorznabCatType.MoviesDVD);
if (!configData.OnlyDanishCategories.Value)
{
AddCategoryMapping(9, TorznabCatType.MoviesHD);
AddCategoryMapping(9, TorznabCatType.Movies);
AddCategoryMapping(9, TorznabCatType.MoviesBluRay);
AddCategoryMapping(47, TorznabCatType.Movies3D);
AddCategoryMapping(5, TorznabCatType.MoviesSD);
}
//TV Mapping
//Category 4: TV (Working)
AddCategoryMapping(4, TorznabCatType.TVSD);
AddCategoryMapping(4, TorznabCatType.TV);
AddCategoryMapping(4, TorznabCatType.TVHD);
//Category 21: Boxset/SD (Working)
AddCategoryMapping(21, TorznabCatType.TVFOREIGN);
//Category 24: Boxsets/TV (Working)
AddCategoryMapping(24, TorznabCatType.TVFOREIGN);
//Category 26: NG Serier WEB-DL (Working)
AddCategoryMapping(26, TorznabCatType.TVHD);
AddCategoryMapping(26, TorznabCatType.TV);
AddCategoryMapping(26, TorznabCatType.TVWEBDL);
//Category 31: TVHD (Working)
AddCategoryMapping(31, TorznabCatType.TVHD);
AddCategoryMapping(31, TorznabCatType.TV);
//Category 43: NG WWW HD (Working)
AddCategoryMapping(43, TorznabCatType.TVHD);
AddCategoryMapping(43, TorznabCatType.TV);
AddCategoryMapping(43, TorznabCatType.TVWEBDL);
//Category 45: TV-Misc (Working)
AddCategoryMapping(45, TorznabCatType.TV);
AddCategoryMapping(45, TorznabCatType.TVSD);
//Category 46: NG Serier HDTV (Working)
AddCategoryMapping(46, TorznabCatType.TVHD);
AddCategoryMapping(46, TorznabCatType.TV);
if (!configData.OnlyDanishCategories.Value)
{
//Category 4: TV (Working)
AddCategoryMapping(4, TorznabCatType.TVSD);
AddCategoryMapping(4, TorznabCatType.TV);
AddCategoryMapping(4, TorznabCatType.TVHD);
//Category 21: Boxset/SD (Working)
AddCategoryMapping(21, TorznabCatType.TVFOREIGN);
//Category 24: Boxsets/TV (Working)
AddCategoryMapping(24, TorznabCatType.TVFOREIGN);
//Category 31: TVHD (Working)
AddCategoryMapping(31, TorznabCatType.TVHD);
AddCategoryMapping(31, TorznabCatType.TV);
//Category 45: TV-Misc (Working)
AddCategoryMapping(45, TorznabCatType.TV);
AddCategoryMapping(45, TorznabCatType.TVSD);
}
// Audio Books
AddCategoryMapping(37, TorznabCatType.AudioAudiobook);
// Books
AddCategoryMapping(8, TorznabCatType.BooksEbook);
}
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
@@ -117,107 +131,121 @@ namespace Jackett.Indexers
passKey = passKey.Substring(0, passKey.IndexOf(' '));
configData.RSSKey.Value = passKey;
SaveConfig();
return IndexerConfigurationStatus.RequiresTesting;
return IndexerConfigurationStatus.Completed;
}
public async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
var releasesPerPage = 100;
var releases = new List<ReleaseInfo>();
var breakWhile = false;
var page = 0;
while (page < 3)
var page = (query.Offset / releasesPerPage);
string episodeSearchUrl;
if (string.IsNullOrEmpty(query.GetQueryString()))
{
string episodeSearchUrl;
if (string.IsNullOrEmpty(query.GetQueryString()))
{
episodeSearchUrl = SearchUrl + "?page=" + page;
breakWhile = true;
}
else
{
var cats = MapTorznabCapsToTrackers(query);
var catsUrlPart = string.Join("&", cats.Select(c => $"c{c}=1"));
episodeSearchUrl = string.Format("{0}?search={1}&cat=0&incldead=0&{2}&page={3}", SearchUrl, HttpUtility.UrlEncode(query.GetQueryString()), catsUrlPart, page);
}
page++;
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
try
{
CQ dom = results.Content;
episodeSearchUrl = SearchUrl + "?page=" + page;
}
else
{
var cats = MapTorznabCapsToTrackers(query);
var catsUrlPart = string.Join("&", cats.Select(c => $"c{c}=1"));
episodeSearchUrl = string.Format("{0}?search={1}&cat=0&incldead=0&{2}&page={3}", SearchUrl, HttpUtility.UrlEncode(query.GetQueryString()), catsUrlPart, page);
}
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
try
{
CQ dom = results.Content;
var rows = dom["#torrent-table-wrapper > div"];
var rows = dom["#torrent-table-wrapper > div"];
foreach (var row in rows.Skip(1))
foreach (var row in rows.Skip(1))
{
var release = new ReleaseInfo();
var qRow = row.Cq();
var qLink = qRow.Find("#torrent-udgivelse2-users > a").First();
var qDesc = qRow.Find("#torrent-udgivelse2-users > p").FirstOrDefault();
var moviesCatsDanish = new[] { 38, 23, 22, 33, 17 };
var moviesCatsIntl = new[] { 47, 5, 9 };
var moviesCats = configData.OnlyDanishCategories.Value
? moviesCatsDanish
: moviesCatsDanish.Concat(moviesCatsIntl);
var seriesCatsDanish = new[] { 26, 43, 46 };
var seriesCatsIntl = new[] { 4, 21, 24, 31, 45 };
var seriesCats = configData.OnlyDanishCategories.Value
? seriesCatsDanish
: seriesCatsDanish.Concat(seriesCatsIntl);
var catUrl = qRow.Find(".torrent-icon > a").Attr("href");
var cat = catUrl.Substring(catUrl.LastIndexOf('=') + 1);
var catNo = int.Parse(cat);
if (moviesCats.Contains(catNo))
release.Category = TorznabCatType.Movies.ID;
else if (seriesCats.Contains(catNo))
release.Category = TorznabCatType.TV.ID;
else
continue;
releases.Add(release);
var torrentUrl = qLink.Attr("href");
var torrentId = torrentUrl.Substring(torrentUrl.LastIndexOf('=') + 1);
release.MinimumRatio = 1;
release.MinimumSeedTime = 172800;
release.Title = qLink.Attr("title");
release.Description = qDesc != null ? qDesc.InnerText : release.Title;
release.Guid = new Uri(SiteLink + torrentUrl);
release.Comments = new Uri(release.Guid + "#startcomments");
var downloadUrl = $"{SiteLink}download.php?id={torrentId}&rss&passkey={configData.RSSKey.Value}";
release.Link = new Uri(downloadUrl);
var qAdded = qRow.Find("#torrent-added").First();
var addedStr = qAdded.Text().Trim();
release.PublishDate = DateTime.ParseExact(addedStr, "dd-MM-yyyyHH:mm:ss", CultureInfo.InvariantCulture);
release.Seeders = ParseUtil.CoerceInt(qRow.Find("#torrent-seeders").Text().Trim());
release.Peers = ParseUtil.CoerceInt(qRow.Find("#torrent-leechers").Text().Trim()) + release.Seeders;
var sizeStr = qRow.Find("#torrent-size").First().Text();
release.Size = ReleaseInfo.GetBytes(sizeStr);
var infoLink = qRow.Find("#infolink");
var linkContainer = infoLink.Children().First().Children().First();
var url = linkContainer.Attr("href");
var img = linkContainer.Children().First();
var imgUrl = img.Attr("src");
if (imgUrl == "/pic/imdb.png")
{
var release = new ReleaseInfo();
var qRow = row.Cq();
var qLink = qRow.Find("#torrent-udgivelse2-users > a").First();
var qDesc = qRow.Find("#torrent-udgivelse2-users > p").FirstOrDefault();
var moviesCats = new[] { 47, 38, 5, 23, 22, 33, 17, 9 };
var seriesCats = new[] { 4, 21, 24, 26, 31, 43, 45, 46 };
var catUrl = qRow.Find(".torrent-icon > a").Attr("href");
var cat = catUrl.Substring(catUrl.LastIndexOf('=') + 1);
var catNo = int.Parse(cat);
if (moviesCats.Contains(catNo))
release.Category = TorznabCatType.Movies.ID;
else if (seriesCats.Contains(catNo))
release.Category = TorznabCatType.TV.ID;
else
continue;
releases.Add(release);
var torrentUrl = qLink.Attr("href");
var torrentId = torrentUrl.Substring(torrentUrl.LastIndexOf('=') + 1);
release.MinimumRatio = 1;
release.MinimumSeedTime = 172800;
release.Title = qLink.Attr("title");
release.Description = qDesc != null ? qDesc.InnerText : release.Title;
release.Guid = new Uri(SiteLink + torrentUrl);
release.Comments = new Uri(release.Guid + "#startcomments");
var downloadUrl = $"{SiteLink}download.php?id={torrentId}&rss&passkey={configData.RSSKey.Value}";
release.Link = new Uri(downloadUrl);
var qAdded = qRow.Find("#torrent-added").First();
var addedStr = qAdded.Text().Trim();
release.PublishDate = DateTime.ParseExact(addedStr, "dd-MM-yyyyHH:mm:ss", CultureInfo.InvariantCulture);
release.Seeders = ParseUtil.CoerceInt(qRow.Find("#torrent-seeders").Text().Trim());
release.Peers = ParseUtil.CoerceInt(qRow.Find("#torrent-leechers").Text().Trim()) + release.Seeders;
var sizeStr = qRow.Find("#torrent-size").First().Text();
release.Size = ReleaseInfo.GetBytes(sizeStr);
var infoLink = qRow.Find("#infolink");
var linkContainer = infoLink.Children().First().Children().First();
var url = linkContainer.Attr("href");
var img = linkContainer.Children().First();
var imgUrl = img.Attr("src");
if (imgUrl == "/pic/imdb.png")
{
release.Imdb = long.Parse(url.Substring(url.LastIndexOf('t') + 1));
}
else if (imgUrl == "/pic/TV.png")
{
release.TVDBId = long.Parse(url.Substring(url.LastIndexOf('=') + 1));
}
release.Imdb = long.Parse(url.Substring(url.LastIndexOf('t') + 1));
}
else if (imgUrl == "/pic/TV.png")
{
release.TVDBId = long.Parse(url.Substring(url.LastIndexOf('=') + 1));
}
var nextPage = dom["#torrent-table-wrapper + p[align=center]"].Children().Last();
if (!nextPage.Is("a"))
breakWhile = true;
}
catch (Exception ex)
{
OnParseError(results.Content, ex);
}
if (breakWhile)
break;
}
catch (Exception ex)
{
OnParseError(results.Content, ex);
}
return releases;
}
public class NxtGnConfigurationData : ConfigurationData
{
public NxtGnConfigurationData()
{
Username = new StringItem { Name = "Username" };
Password = new StringItem { Name = "Password" };
RSSKey = new HiddenItem { Name = "RSSKey" };
OnlyDanishCategories = new BoolItem { Name = "Only Danish Categories" };
}
public StringItem Username { get; private set; }
public StringItem Password { get; private set; }
public HiddenItem RSSKey { get; private set; }
public BoolItem OnlyDanishCategories { get; private set; }
}
}
}

View File

@@ -34,7 +34,7 @@ namespace Jackett.Indexers
public TorrentDay(IIndexerManagerService i, Logger l, IWebClient wc, IProtectionService ps)
: base(name: "TorrentDay",
description: "TorrentDay",
link: "https://torrentday.eu/",
link: "https://tdonline.org/",
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
manager: i,
client: wc,

View File

@@ -110,6 +110,10 @@
<HintPath>..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MonoTorrent, Version=0.80.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoTorrent.0.9.0\lib\net20\MonoTorrent.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
@@ -186,6 +190,7 @@
<Compile Include="Indexers\Demonoid.cs" />
<Compile Include="Indexers\FrenchTorrentDb.cs" />
<Compile Include="Indexers\BroadcastTheNet.cs" />
<Compile Include="Indexers\DanishBits.cs" />
<Compile Include="Indexers\TehConnection.cs" />
<Compile Include="Indexers\Hounddawgs.cs" />
<Compile Include="Indexers\Shazbat.cs" />
@@ -437,6 +442,9 @@
<Content Include="Content\logos\broadcastthenet.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\logos\danishbits.PNG">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\logos\demonoid.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -635,4 +643,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>
</Project>

View File

@@ -32,7 +32,7 @@ namespace Jackett.Services
void ReserveUrls(bool doInstall = true);
ServerConfig Config { get; }
void SaveConfig();
Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent");
Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "t.torrent");
}
public class ServerService : IServerService
@@ -65,13 +65,13 @@ namespace Jackett.Services
get { return config; }
}
public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent")
public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "t.torrent")
{
if (link == null || (link.IsAbsoluteUri && link.Scheme == "magnet"))
return link;
var encodedLink = HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes(link.ToString())) + file;
var proxyLink = string.Format("{0}{1}/{2}/{3}/{4}", serverUrl, action, indexerId, config.APIKey, encodedLink);
var encodedLink = HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes(link.ToString()));
var proxyLink = string.Format("{0}{1}/{2}/{3}?path={4}&file={5}", serverUrl, action, indexerId, config.APIKey, encodedLink, file);
return new Uri(proxyLink);
}

View File

@@ -111,7 +111,7 @@ namespace Jackett
config.Routes.MapHttpRoute(
name: "download",
routeTemplate: "dl/{indexerID}/{apikey}/{path}/t.torrent",
routeTemplate: "dl/{indexerID}/{apiKey}",
defaults: new { controller = "Download", action = "Download" }
);

View File

@@ -22,6 +22,7 @@
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.StaticFiles" version="3.0.1" targetFramework="net45" />
<package id="MonoTorrent" version="0.9.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NLog" version="4.0.1" targetFramework="net45" />
<package id="NLog.Windows.Forms" version="2.0.0.0" targetFramework="net45" />