2017-10-29 06:21:18 +00:00
|
|
|
|
using System;
|
2016-10-29 20:14:38 +00:00
|
|
|
|
using System.Collections.Generic;
|
2017-04-15 08:45:10 +00:00
|
|
|
|
using System.Collections.Specialized;
|
2017-10-29 06:21:18 +00:00
|
|
|
|
using System.Globalization;
|
2017-11-20 14:27:25 +00:00
|
|
|
|
using System.Linq;
|
2017-10-29 06:21:18 +00:00
|
|
|
|
using System.Text;
|
2017-04-15 08:45:10 +00:00
|
|
|
|
using System.Text.RegularExpressions;
|
2017-10-29 06:21:18 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using AngleSharp.Dom;
|
|
|
|
|
using AngleSharp.Parser.Html;
|
|
|
|
|
using Jackett.Models;
|
|
|
|
|
using Jackett.Models.IndexerConfig;
|
2017-10-29 10:19:09 +00:00
|
|
|
|
using Jackett.Services.Interfaces;
|
2017-10-29 06:21:18 +00:00
|
|
|
|
using Jackett.Utils;
|
|
|
|
|
using Jackett.Utils.Clients;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using NLog;
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
namespace Jackett.Indexers
|
|
|
|
|
{
|
2017-07-10 20:58:44 +00:00
|
|
|
|
public class BJShare : BaseWebIndexer
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
2017-10-29 06:21:18 +00:00
|
|
|
|
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
|
|
|
|
private string BrowseUrl { get { return SiteLink + "torrents.php"; } }
|
|
|
|
|
private string TodayUrl { get { return SiteLink + "torrents.php?action=today"; } }
|
2017-11-20 14:27:25 +00:00
|
|
|
|
private char[] digits = new[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
|
2016-10-29 20:14:38 +00:00
|
|
|
|
|
2017-10-29 06:21:18 +00:00
|
|
|
|
private new ConfigurationDataBasicLoginWithRSSAndDisplay configData
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
|
|
|
|
get { return (ConfigurationDataBasicLoginWithRSSAndDisplay)base.configData; }
|
|
|
|
|
set { base.configData = value; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-05 09:42:03 +00:00
|
|
|
|
public BJShare(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
|
2016-10-29 20:14:38 +00:00
|
|
|
|
: base(name: "BJ-Share",
|
|
|
|
|
description: "A brazilian tracker.",
|
|
|
|
|
link: "https://bj-share.me/",
|
|
|
|
|
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
|
2017-07-10 20:58:44 +00:00
|
|
|
|
configService: configService,
|
2016-10-29 20:14:38 +00:00
|
|
|
|
client: wc,
|
|
|
|
|
logger: l,
|
|
|
|
|
p: ps,
|
|
|
|
|
configData: new ConfigurationDataBasicLoginWithRSSAndDisplay())
|
2017-04-15 08:45:10 +00:00
|
|
|
|
{
|
2017-11-05 09:42:03 +00:00
|
|
|
|
Encoding = Encoding.UTF8;
|
2016-12-09 17:20:58 +00:00
|
|
|
|
Language = "pt-br";
|
2017-01-27 15:57:32 +00:00
|
|
|
|
Type = "private";
|
2016-12-06 13:56:47 +00:00
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
AddCategoryMapping(14, TorznabCatType.TVAnime); // Anime
|
|
|
|
|
AddCategoryMapping(3, TorznabCatType.PC0day); // Aplicativos
|
|
|
|
|
AddCategoryMapping(8, TorznabCatType.Other); // Apostilas/Tutoriais
|
|
|
|
|
AddCategoryMapping(19, TorznabCatType.AudioAudiobook); // Audiobook
|
|
|
|
|
AddCategoryMapping(16, TorznabCatType.TVOTHER); // Desenho Animado
|
|
|
|
|
AddCategoryMapping(18, TorznabCatType.TVDocumentary); // Documentários
|
|
|
|
|
AddCategoryMapping(10, TorznabCatType.Books); // E-Books
|
|
|
|
|
AddCategoryMapping(20, TorznabCatType.TVSport); // Esportes
|
|
|
|
|
AddCategoryMapping(1, TorznabCatType.Movies); // Filmes
|
|
|
|
|
AddCategoryMapping(12, TorznabCatType.MoviesOther); // Histórias em Quadrinhos
|
|
|
|
|
AddCategoryMapping(5, TorznabCatType.Audio); // Músicas
|
|
|
|
|
AddCategoryMapping(7, TorznabCatType.Other); // Outros
|
|
|
|
|
AddCategoryMapping(9, TorznabCatType.BooksMagazines); // Revistas
|
|
|
|
|
AddCategoryMapping(2, TorznabCatType.TV); // Seriados
|
|
|
|
|
AddCategoryMapping(17, TorznabCatType.TV); // Shows
|
|
|
|
|
AddCategoryMapping(13, TorznabCatType.TV); // Stand Up Comedy
|
|
|
|
|
AddCategoryMapping(11, TorznabCatType.Other); // Video-Aula
|
|
|
|
|
AddCategoryMapping(6, TorznabCatType.TV); // Vídeos de TV
|
|
|
|
|
AddCategoryMapping(4, TorznabCatType.Other); // Jogos
|
2017-04-15 08:45:10 +00:00
|
|
|
|
AddCategoryMapping(199, TorznabCatType.XXX); // Filmes Adultos
|
|
|
|
|
AddCategoryMapping(200, TorznabCatType.XXX); // Jogos Adultos
|
2016-10-29 20:14:38 +00:00
|
|
|
|
AddCategoryMapping(201, TorznabCatType.XXXImageset); // Fotos Adultas
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-28 05:31:38 +00:00
|
|
|
|
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
2017-01-02 20:39:28 +00:00
|
|
|
|
LoadValuesFromJson(configJson);
|
2016-10-29 20:14:38 +00:00
|
|
|
|
|
|
|
|
|
var pairs = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "username", configData.Username.Value },
|
|
|
|
|
{ "password", configData.Password.Value },
|
|
|
|
|
{ "keeplogged", "1" }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl, true);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () =>
|
|
|
|
|
{
|
|
|
|
|
var errorMessage = result.Content;
|
|
|
|
|
throw new ExceptionWithConfigData(errorMessage, configData);
|
2016-10-29 20:14:38 +00:00
|
|
|
|
});
|
|
|
|
|
return IndexerConfigurationStatus.RequiresTesting;
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-20 14:27:25 +00:00
|
|
|
|
private string StripSearchString(string term, bool isAnime)
|
2017-04-15 08:45:10 +00:00
|
|
|
|
{
|
|
|
|
|
// Search does not support searching with episode numbers so strip it if we have one
|
|
|
|
|
// Ww AND filter the result later to archive the proper result
|
2018-01-09 15:39:23 +00:00
|
|
|
|
if (isAnime)
|
|
|
|
|
{
|
|
|
|
|
return term.TrimEnd(digits);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ret = Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim();
|
|
|
|
|
return ret.Replace("Agents of SHIELD", "Agents of S.H.I.E.L.D.");
|
2016-11-01 08:22:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-03 05:15:47 +00:00
|
|
|
|
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
|
|
|
|
var releases = new List<ReleaseInfo>();
|
2017-10-29 06:21:18 +00:00
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
// if the search string is empty use the "last 24h torrents" view
|
2018-01-09 15:39:23 +00:00
|
|
|
|
if (string.IsNullOrWhiteSpace(query.SearchTerm))
|
2017-04-15 08:45:10 +00:00
|
|
|
|
{
|
2016-10-29 20:14:38 +00:00
|
|
|
|
var results = await RequestStringWithCookies(TodayUrl);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string RowsSelector = "table.torrent_table > tbody > tr:not(tr.colhead)";
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var SearchResultParser = new HtmlParser();
|
2016-10-29 20:14:38 +00:00
|
|
|
|
var SearchResultDocument = SearchResultParser.Parse(results.Content);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
|
|
|
|
foreach (var Row in Rows)
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
2017-04-15 08:45:10 +00:00
|
|
|
|
try
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
|
|
|
|
var release = new ReleaseInfo();
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.MinimumRatio = 1;
|
2016-10-29 20:14:38 +00:00
|
|
|
|
release.MinimumSeedTime = 0;
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
|
|
|
|
var qDetailsLink = Row.QuerySelector("a.BJinfoBox");
|
|
|
|
|
var qTitle = qDetailsLink.QuerySelector("font");
|
|
|
|
|
release.Title = qTitle.TextContent;
|
|
|
|
|
|
|
|
|
|
var qBJinfoBox = qDetailsLink.QuerySelector("span");
|
|
|
|
|
var qCatLink = Row.QuerySelector("a[href^=\"/torrents.php?filter_cat\"]");
|
|
|
|
|
var qDLLink = Row.QuerySelector("a[href^=\"torrents.php?action=download\"]");
|
|
|
|
|
var qSeeders = Row.QuerySelector("td:nth-child(4)");
|
|
|
|
|
var qLeechers = Row.QuerySelector("td:nth-child(5)");
|
|
|
|
|
var qFreeLeech = Row.QuerySelector("font[color=\"green\"]:contains(Free)");
|
|
|
|
|
|
|
|
|
|
release.Description = "";
|
|
|
|
|
foreach (var Child in qBJinfoBox.ChildNodes)
|
|
|
|
|
{
|
|
|
|
|
var type = Child.NodeType;
|
|
|
|
|
if (type != NodeType.Text)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
var line = Child.TextContent;
|
|
|
|
|
if (line.StartsWith("Tamanho:"))
|
|
|
|
|
{
|
|
|
|
|
string Size = line.Substring("Tamanho: ".Length); ;
|
|
|
|
|
release.Size = ReleaseInfo.GetBytes(Size);
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("Lançado em: "))
|
|
|
|
|
{
|
|
|
|
|
string PublishDateStr = line.Substring("Lançado em: ".Length).Replace("às ", "");
|
|
|
|
|
PublishDateStr += " +0";
|
|
|
|
|
var PublishDate = DateTime.SpecifyKind(DateTime.ParseExact(PublishDateStr, "dd/MM/yyyy HH:mm z", CultureInfo.InvariantCulture), DateTimeKind.Unspecified);
|
|
|
|
|
release.PublishDate = PublishDate.ToLocalTime();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
release.Description += line + "\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var catStr = qCatLink.GetAttribute("href").Split('=')[1];
|
2017-11-20 14:27:25 +00:00
|
|
|
|
// if result is an anime, convert title from SXXEXX to EXX
|
|
|
|
|
if (catStr == "14")
|
|
|
|
|
{
|
|
|
|
|
release.Title = Regex.Replace(release.Title, @"(Ep[\.]?[ ]?)|([S]\d\d[Ee])", "E");
|
|
|
|
|
}
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.Category = MapTrackerCatToNewznab(catStr);
|
|
|
|
|
|
|
|
|
|
release.Link = new Uri(SiteLink + qDLLink.GetAttribute("href"));
|
|
|
|
|
release.Comments = new Uri(SiteLink + qDetailsLink.GetAttribute("href"));
|
|
|
|
|
release.Guid = release.Link;
|
|
|
|
|
|
|
|
|
|
release.Seeders = ParseUtil.CoerceInt(qSeeders.TextContent);
|
|
|
|
|
release.Peers = ParseUtil.CoerceInt(qLeechers.TextContent) + release.Seeders;
|
|
|
|
|
|
|
|
|
|
if (qFreeLeech != null)
|
|
|
|
|
release.DownloadVolumeFactor = 0;
|
2016-10-29 20:14:38 +00:00
|
|
|
|
else
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.DownloadVolumeFactor = 1;
|
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
release.UploadVolumeFactor = 1;
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
releases.Add(release);
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
2017-04-15 08:45:10 +00:00
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logger.Error(string.Format("{0}: Error while parsing row '{1}': {2}", ID, Row.OuterHtml, ex.Message));
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
OnParseError(results.Content, ex);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
}
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
2017-04-15 08:45:10 +00:00
|
|
|
|
else // use search
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var searchUrl = BrowseUrl;
|
2017-11-20 14:27:25 +00:00
|
|
|
|
var isSearchAnime = query.Categories.Any(s => s == TorznabCatType.TVAnime.ID);
|
2018-01-09 15:39:23 +00:00
|
|
|
|
|
|
|
|
|
query.SearchTerm = query.SearchTerm.Replace("Agents of SHIELD", "Agents of S.H.I.E.L.D.");
|
|
|
|
|
var searchString = query.GetQueryString();
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
2018-01-09 15:39:23 +00:00
|
|
|
|
var queryCollection = new NameValueCollection
|
|
|
|
|
{
|
|
|
|
|
{"searchstr", StripSearchString(searchString, isSearchAnime)},
|
|
|
|
|
{"order_by", "time"},
|
|
|
|
|
{"order_way", "desc"},
|
|
|
|
|
{"group_results", "1"},
|
|
|
|
|
{"action", "basic"},
|
|
|
|
|
{"searchsubmit", "1"}
|
|
|
|
|
};
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
|
|
|
|
foreach (var cat in MapTorznabCapsToTrackers(query))
|
|
|
|
|
{
|
2017-10-29 06:21:18 +00:00
|
|
|
|
queryCollection.Add("filter_cat[" + cat + "]", "1");
|
2017-04-15 08:45:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchUrl += "?" + queryCollection.GetQueryString();
|
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
var results = await RequestStringWithCookies(searchUrl);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string RowsSelector = "table.torrent_table > tbody > tr:not(tr.colhead)";
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var SearchResultParser = new HtmlParser();
|
2016-10-29 20:14:38 +00:00
|
|
|
|
var SearchResultDocument = SearchResultParser.Parse(results.Content);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var Rows = SearchResultDocument.QuerySelectorAll(RowsSelector);
|
|
|
|
|
|
|
|
|
|
ICollection<int> GroupCategory = null;
|
|
|
|
|
string GroupTitle = null;
|
|
|
|
|
string GroupYearStr = null;
|
|
|
|
|
Nullable<DateTime> GroupPublishDate = null;
|
|
|
|
|
|
|
|
|
|
foreach (var Row in Rows)
|
2016-10-29 20:14:38 +00:00
|
|
|
|
{
|
2017-04-15 08:45:10 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var qDetailsLink = Row.QuerySelector("a[href^=\"torrents.php?id=\"]");
|
|
|
|
|
string Title = qDetailsLink.TextContent;
|
|
|
|
|
ICollection<int> Category = null;
|
|
|
|
|
string YearStr = null;
|
|
|
|
|
Nullable<DateTime> YearPublishDate = null;
|
2017-12-26 04:02:43 +00:00
|
|
|
|
string CategoryStr = "";
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
|
|
|
|
if (Row.ClassList.Contains("group") || Row.ClassList.Contains("torrent")) // group/ungrouped headers
|
|
|
|
|
{
|
|
|
|
|
var qCatLink = Row.QuerySelector("a[href^=\"/torrents.php?filter_cat\"]");
|
2017-12-26 04:02:43 +00:00
|
|
|
|
CategoryStr = qCatLink.GetAttribute("href").Split('=')[1].Split('&')[0];
|
2017-04-15 08:45:10 +00:00
|
|
|
|
Category = MapTrackerCatToNewznab(CategoryStr);
|
2017-12-26 04:02:43 +00:00
|
|
|
|
|
|
|
|
|
YearStr = qDetailsLink.NextSibling.TextContent.Trim().TrimStart('[').TrimEnd(']');
|
|
|
|
|
YearPublishDate = DateTime.SpecifyKind(DateTime.ParseExact(YearStr, "yyyy", CultureInfo.InvariantCulture), DateTimeKind.Unspecified);
|
2017-11-20 14:27:25 +00:00
|
|
|
|
|
|
|
|
|
// if result is an anime, convert title from SXXEXX to EXX
|
|
|
|
|
if (CategoryStr == "14")
|
|
|
|
|
{
|
|
|
|
|
Title = Regex.Replace(Title, @"(Ep[\.]?[ ]?)|([S]\d\d[Ee])", "E");
|
|
|
|
|
}
|
2017-04-15 08:45:10 +00:00
|
|
|
|
|
|
|
|
|
if (Row.ClassList.Contains("group")) // group headers
|
|
|
|
|
{
|
|
|
|
|
GroupCategory = Category;
|
|
|
|
|
GroupTitle = Title;
|
|
|
|
|
GroupYearStr = YearStr;
|
|
|
|
|
GroupPublishDate = YearPublishDate;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
var release = new ReleaseInfo();
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.MinimumRatio = 1;
|
|
|
|
|
release.MinimumSeedTime = 0;
|
|
|
|
|
|
|
|
|
|
var qDLLink = Row.QuerySelector("a[href^=\"torrents.php?action=download\"]");
|
|
|
|
|
var qSize = Row.QuerySelector("td:nth-last-child(4)");
|
2017-11-08 16:33:40 +00:00
|
|
|
|
var qGrabs = Row.QuerySelector("td:nth-last-child(3)");
|
|
|
|
|
var qSeeders = Row.QuerySelector("td:nth-last-child(2)");
|
|
|
|
|
var qLeechers = Row.QuerySelector("td:nth-last-child(1)");
|
2017-04-15 08:45:10 +00:00
|
|
|
|
var qFreeLeech = Row.QuerySelector("strong[title=\"Free\"]");
|
|
|
|
|
|
|
|
|
|
if (Row.ClassList.Contains("group_torrent")) // torrents belonging to a group
|
|
|
|
|
{
|
|
|
|
|
release.Description = qDetailsLink.TextContent;
|
2017-12-26 04:02:43 +00:00
|
|
|
|
|
|
|
|
|
string cleanTitle = Regex.Replace(GroupTitle, @" - S?(?<season>\d{1,2})?E?(?<episode>\d{1,4})?", "");
|
|
|
|
|
string seasonEp = Regex.Replace(GroupTitle, @"^(.*?) - (S?(\d{1,2})?E?(\d{1,4})?)?", "$2");
|
|
|
|
|
release.Title = CategoryStr == "14" ? GroupTitle : cleanTitle + " " + GroupYearStr + " " + seasonEp;
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.PublishDate = GroupPublishDate.Value;
|
|
|
|
|
release.Category = GroupCategory;
|
|
|
|
|
}
|
|
|
|
|
else if (Row.ClassList.Contains("torrent")) // standalone/un grouped torrents
|
|
|
|
|
{
|
|
|
|
|
var qDescription = Row.QuerySelector("div.torrent_info");
|
|
|
|
|
release.Description = qDescription.TextContent;
|
2017-12-26 04:02:43 +00:00
|
|
|
|
|
|
|
|
|
string cleanTitle = Regex.Replace(Title, @" - ((S(\d{1,2}))?E(\d{1,4}))", "");
|
|
|
|
|
string seasonEp = Regex.Replace(Title, @"^(.*?) - ((S(\d{1,2}))?E(\d{1,4}))", "$2");
|
|
|
|
|
release.Title = CategoryStr == "14" ? Title : cleanTitle + " " + YearStr + " " + seasonEp;
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.PublishDate = YearPublishDate.Value;
|
|
|
|
|
release.Category = Category;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
release.Description = release.Description.Replace(" / Free", ""); // Remove Free Tag
|
2017-10-29 06:21:18 +00:00
|
|
|
|
|
2017-04-20 08:22:45 +00:00
|
|
|
|
release.Description = release.Description.Replace("Full HD", "1080p");
|
2017-07-11 19:58:01 +00:00
|
|
|
|
release.Description = release.Description.Replace("/ HD / ", "/ 720p /");
|
2017-07-10 19:19:22 +00:00
|
|
|
|
release.Description = release.Description.Replace(" / HD]", " / 720p]");
|
2017-04-20 08:22:45 +00:00
|
|
|
|
release.Description = release.Description.Replace("4K", "2160p");
|
|
|
|
|
|
|
|
|
|
int nBarra = release.Title.IndexOf("[");
|
|
|
|
|
if (nBarra != -1)
|
|
|
|
|
{
|
2017-10-29 06:21:18 +00:00
|
|
|
|
release.Title = release.Title.Substring(nBarra + 1);
|
|
|
|
|
release.Title = release.Title.Replace("]", "");
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.Title += " " + release.Description; // add year and Description to the release Title to add some meaning to it
|
|
|
|
|
|
|
|
|
|
// check for previously stripped search terms
|
|
|
|
|
if (!query.MatchQueryStringAND(release.Title))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
var Size = qSize.TextContent;
|
|
|
|
|
release.Size = ReleaseInfo.GetBytes(Size);
|
|
|
|
|
|
|
|
|
|
release.Link = new Uri(SiteLink + qDLLink.GetAttribute("href"));
|
|
|
|
|
release.Comments = new Uri(SiteLink + qDetailsLink.GetAttribute("href"));
|
|
|
|
|
release.Guid = release.Link;
|
|
|
|
|
|
2017-11-08 16:33:40 +00:00
|
|
|
|
release.Grabs = ParseUtil.CoerceLong(qGrabs.TextContent);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.Seeders = ParseUtil.CoerceInt(qSeeders.TextContent);
|
|
|
|
|
release.Peers = ParseUtil.CoerceInt(qLeechers.TextContent) + release.Seeders;
|
|
|
|
|
|
|
|
|
|
if (qFreeLeech != null)
|
|
|
|
|
release.DownloadVolumeFactor = 0;
|
2016-10-29 20:14:38 +00:00
|
|
|
|
else
|
2017-04-15 08:45:10 +00:00
|
|
|
|
release.DownloadVolumeFactor = 1;
|
|
|
|
|
|
2016-10-29 20:14:38 +00:00
|
|
|
|
release.UploadVolumeFactor = 1;
|
|
|
|
|
|
2017-04-15 08:45:10 +00:00
|
|
|
|
releases.Add(release);
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
2017-04-15 08:45:10 +00:00
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logger.Error(string.Format("{0}: Error while parsing row '{1}': {2}", ID, Row.OuterHtml, ex.Message));
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
OnParseError(results.Content, ex);
|
2017-04-15 08:45:10 +00:00
|
|
|
|
}
|
2016-10-29 20:14:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return releases;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|