anidub: add RUS to title and retry to requests (#5535)

* Changed http requests to have a retry for AniDUB

* Append RUS language tag to releases from AniDUB tracker
This commit is contained in:
MsKrypt1 2019-06-23 23:08:22 +03:00 committed by garfield69
parent 5f15651e19
commit f38f7a9227
1 changed files with 15 additions and 4 deletions

View File

@ -149,7 +149,7 @@ namespace Jackett.Common.Indexers
private async Task EnsureAuthorized()
{
var result = await RequestStringWithCookies(SiteLink);
var result = await RequestStringWithCookiesAndRetry(SiteLink);
if (!IsAuthorized(result))
{
@ -161,7 +161,7 @@ namespace Jackett.Common.Indexers
{
const string ReleaseLinksSelector = "#dle-content > .story > .story_h > .lcol > h2 > a";
var result = await RequestStringWithCookies(SiteLink);
var result = await RequestStringWithCookiesAndRetry(SiteLink);
var releases = new List<ReleaseInfo>();
try
@ -199,7 +199,7 @@ namespace Jackett.Common.Indexers
return releases;
}
var result = await RequestStringWithCookies(url);
var result = await RequestStringWithCookiesAndRetry(url);
try
{
@ -389,6 +389,15 @@ namespace Jackett.Common.Indexers
baseTitle = FixMovieInfo(baseTitle);
// Mostly audio is in original name, which can't be known during parsing
// Skipping appending russing language tag
var isAudio = categories.Contains(TorznabCatType.Audio.ID);
if (!isAudio)
{
baseTitle = AppendRussianLanguageTag(baseTitle);
}
return baseTitle.Trim();
}
@ -456,6 +465,8 @@ namespace Jackett.Common.Indexers
match => match.Success ? $"S{int.Parse(match.Groups[1].Value):00}" : string.Empty
);
private static string AppendRussianLanguageTag(string title) => title + " [RUS]";
private DateTime GetDateFromShowPage(string url, IElement content)
{
const string dateFormat = "d-MM-yyyy";
@ -527,7 +538,7 @@ namespace Jackett.Common.Indexers
var releases = new List<ReleaseInfo>();
var response = await PostDataWithCookies(SearchUrl, PreparePostData(query));
var response = await PostDataWithCookiesAndRetry(SearchUrl, PreparePostData(query));
try
{