Speed-Share: Added resolution; removed year from title, since it was not reliable, and added few workarounds to improve the search on some shows; BJ-Share and Manicomio-Share, added few workarounds to improve search on few shows; PS: Still need find an reliable pattern to remove translated series name from Manicomio-Share, i just added an workaround to few shows for now (#2391)

This commit is contained in:
DarkSupremo 2018-01-09 13:39:23 -02:00 committed by kaso17
parent 70ca19c6d9
commit 9e1bec1ea4
3 changed files with 72 additions and 22 deletions

View File

@ -218,6 +218,8 @@
# workaroud to remove year in search keywords
- name: re_replace
args: ["([1-2]\\d{3})", ""]
- name: replace
args: ["Agents of SHIELD", "Agents of S.H.I.E.L.D."]
- name: re_replace
args: ["[^a-zA-Z0-9]+", "%"]
inputs:
@ -245,6 +247,27 @@
args: ["|", ""]
- name: replace
args: ["Ep. ","E"]
- name: re_replace
args: ["(\\d{2})[ºª°] Temporada( Completa)?", "S$1"]
- name: re_replace
args: ["(\\d{1})[ºª°] Temporada( Completa)?", "S0$1"]
# Workaround to add year to series that is an remake, since the year returned from the tracker isn't reliable, feel free to add more as needed.
- name: re_replace
args: ["^Doctor Who", "Doctor Who 2005"]
- name: re_replace
args: ["^Extinct", "Extinct 2017"]
- name: re_replace
args: ["^The Flash", "The Flash 2014"]
- name: re_replace
args: ["^The Magicians", "The Magicians 2015"]
# Workaround to remove the translated name from the series, didn't found an better and reliable way to do this, feel free to add more as needed.
- name: replace
args: ["O Sócio - The Profit", "The Profit"]
- name: replace
args: ["Arquivo X - The X Files", "The X Files"]
- name: replace
args: ["Deuses Americanos - American Gods", "American Gods"]
size:
selector: td:nth-child(4)
grabs:

View File

@ -196,6 +196,8 @@
# workaroud to remove year in search keywords
- name: re_replace
args: ["([1-2]\\d{3})", ""]
- name: replace
args: ["Agents of SHIELD", "Agents of S.H.I.E.L.D."]
inputs:
number: 100
offset: 0
@ -220,11 +222,6 @@
,a[href^="torrents.php?cat=228"]
,a[href^="torrents.php?cat=191"]
attribute: href
year:
selector: td.label > div:contains("Lançamento:")
filters:
- name: replace
args: ["Lançamento:", ""]
title_anime:
selector: a[href^="torrents-details.php?id="]
filters:
@ -234,7 +231,16 @@
selector: a[href^="torrents-details.php?id="]
filters:
- name: re_replace
args: ["^(.*?) - ((S(\\d{1,2}))?E(\\d{1,3}))", "$1 {{.Result.year}} $2"]
args: ["^(.*?) - ((S(\\d{1,2}))?E(\\d{1,3}))", "$1 $2"]
# Workaround to add year to series that is an remake, since the year returned from the tracker isn't reliable, feel free to add more as needed.
- name: re_replace
args: ["^Doctor Who", "Doctor Who 2005"]
- name: re_replace
args: ["^Extinct", "Extinct 2017"]
- name: re_replace
args: ["^The Flash", "The Flash 2014"]
- name: re_replace
args: ["^The Magicians", "The Magicians 2015"]
title:
text: "{{if .Result.is_anime }}{{ .Result.title_anime }}{{else}}{{ .Result.title_normal }}{{end}}"
filters:
@ -243,15 +249,15 @@
- name: replace
args: [" - NOVO!", ""]
- name: re_replace
args: ["(\\d{2})ª a (\\d{2})ª Temporada", "S$1-$2"]
args: ["(\\d{2})ª°] a (\\d{2})ª°] Temporada", "S$1-$2"]
- name: re_replace
args: ["(\\d{1})ª a (\\d{1})ª Temporada", "S0$1-0$2"]
args: ["(\\d{1})ª°] a (\\d{1})ª°] Temporada", "S0$1-0$2"]
- name: re_replace
args: ["(\\d{1})ª a (\\d{2})ª Temporada", "S0$1-$2"]
args: ["(\\d{1})ª°] a (\\d{2})ª°] Temporada", "S0$1-$2"]
- name: re_replace
args: ["(\\d{2})ª Temporada", "S$1"]
args: ["(\\d{2})ª°] Temporada", "S$1"]
- name: re_replace
args: ["(\\d{1})ª Temporada", "S0$1"]
args: ["(\\d{1})ª°] Temporada", "S0$1"]
title|append:
optional: true
selector: td.label > div:contains("Qualidade:")
@ -260,6 +266,18 @@
args: ["Qualidade:", ""]
- name: replace
args: ["Autorado", ""]
title|append:
optional: true
selector: td.label > div:contains("Resolução:")
filters:
- name: replace
args: ["Resolução:", ""]
- name: re_replace
args: ["(\\d{3,4})[ ]?x[ ]?(1[0-9][0-9][0-9])", "1080p"]
- name: re_replace
args: ["(\\d{3,4})[ ]?x[ ]?([2-9][0-9][0-9][0-9])", "2160p"]
- name: re_replace
args: ["(\\d{3,4})[ ]?x[ ]?([7-9][0-9][0-9])", "720p"]
download:
selector: a[href^="torrents-details.php?id="]
attribute: href

View File

@ -94,17 +94,21 @@ Encoding = Encoding.UTF8;
{
// 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
return isAnime ? term.TrimEnd(digits) : Regex.Replace(term, @"[S|E]\d\d", string.Empty).Trim();
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.");
}
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
var releases = new List<ReleaseInfo>();
var searchString = query.GetQueryString();
// if the search string is empty use the "last 24h torrents" view
if (string.IsNullOrWhiteSpace(searchString))
if (string.IsNullOrWhiteSpace(query.SearchTerm))
{
var results = await RequestStringWithCookies(TodayUrl);
try
@ -199,14 +203,19 @@ Encoding = Encoding.UTF8;
{
var searchUrl = BrowseUrl;
var isSearchAnime = query.Categories.Any(s => s == TorznabCatType.TVAnime.ID);
query.SearchTerm = query.SearchTerm.Replace("Agents of SHIELD", "Agents of S.H.I.E.L.D.");
var searchString = query.GetQueryString();
var queryCollection = new NameValueCollection();
queryCollection.Add("searchstr", StripSearchString(searchString, isSearchAnime));
queryCollection.Add("order_by", "time");
queryCollection.Add("order_way", "desc");
queryCollection.Add("group_results", "1");
queryCollection.Add("action", "basic");
queryCollection.Add("searchsubmit", "1");
var queryCollection = new NameValueCollection
{
{"searchstr", StripSearchString(searchString, isSearchAnime)},
{"order_by", "time"},
{"order_way", "desc"},
{"group_results", "1"},
{"action", "basic"},
{"searchsubmit", "1"}
};
foreach (var cat in MapTorznabCapsToTrackers(query))
{