mirror of https://github.com/Jackett/Jackett
mejortorrent: support use of special characters (#13761)
also add colon as a supported character inside TorznabQueries Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com>
This commit is contained in:
parent
9006f3c330
commit
22e933bdb9
|
@ -92,7 +92,8 @@ namespace Jackett.Common.Indexers
|
||||||
MusicSearchParams = new List<MusicSearchParam>
|
MusicSearchParams = new List<MusicSearchParam>
|
||||||
{
|
{
|
||||||
MusicSearchParam.Q
|
MusicSearchParam.Q
|
||||||
}
|
},
|
||||||
|
SupportsRawSearch = true
|
||||||
},
|
},
|
||||||
configService: configService,
|
configService: configService,
|
||||||
client: w,
|
client: w,
|
||||||
|
@ -415,7 +416,7 @@ namespace Jackett.Common.Indexers
|
||||||
return queryWords.All(word => titleWords.Contains(word));
|
return queryWords.All(word => titleWords.Contains(word));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TorznabQuery ParseQuery(TorznabQuery query)
|
private TorznabQuery ParseQuery(TorznabQuery query)
|
||||||
{
|
{
|
||||||
// Eg. Doctor.Who.2005.(Доктор.Кто).S02E08
|
// Eg. Doctor.Who.2005.(Доктор.Кто).S02E08
|
||||||
|
|
||||||
|
@ -425,9 +426,10 @@ namespace Jackett.Common.Indexers
|
||||||
// query.Episode = 8
|
// query.Episode = 8
|
||||||
var searchTerm = query.GetQueryString();
|
var searchTerm = query.GetQueryString();
|
||||||
|
|
||||||
// replace non-english alphanumeric characters with spaces
|
// Server returns a 500 error if a UTF character higher than \u00FF (ÿ) is included,
|
||||||
|
// so we need to strip them
|
||||||
// searchTerm = Doctor Who 2005
|
// searchTerm = Doctor Who 2005
|
||||||
searchTerm = Regex.Replace(searchTerm, @"[^a-zA-Z0-9]+", " ");
|
searchTerm = Regex.Replace(searchTerm, @"[^\u0001-\u00FF]+", " ");
|
||||||
searchTerm = Regex.Replace(searchTerm, @"\s+", " ");
|
searchTerm = Regex.Replace(searchTerm, @"\s+", " ");
|
||||||
searchTerm = searchTerm.Trim();
|
searchTerm = searchTerm.Trim();
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ namespace Jackett.Common.Models
|
||||||
|| c == ']'
|
|| c == ']'
|
||||||
|| c == '+'
|
|| c == '+'
|
||||||
|| c == '%'
|
|| c == '%'
|
||||||
|
|| c == ':'
|
||||||
));
|
));
|
||||||
return string.Concat(safeTitle);
|
return string.Concat(safeTitle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue