mirror of https://github.com/Jackett/Jackett
epublibre: add server overloaded message (#7697)
This commit is contained in:
parent
15841e26a8
commit
fed41d5b68
|
@ -20,6 +20,7 @@ namespace Jackett.Common.Indexers
|
||||||
public class EpubLibre : BaseWebIndexer
|
public class EpubLibre : BaseWebIndexer
|
||||||
{
|
{
|
||||||
private string SearchUrl => SiteLink + "catalogo/index/{0}/nuevo/todos/sin/todos/{1}/ajax";
|
private string SearchUrl => SiteLink + "catalogo/index/{0}/nuevo/todos/sin/todos/{1}/ajax";
|
||||||
|
private string SobrecargaUrl => SiteLink + "inicio/sobrecarga";
|
||||||
private const int MaxItemsPerPage = 18;
|
private const int MaxItemsPerPage = 18;
|
||||||
private const int MaxSearchPageLimit = 6; // 18 items per page * 6 pages = 108
|
private const int MaxSearchPageLimit = 6; // 18 items per page * 6 pages = 108
|
||||||
private readonly Dictionary<string, string> _apiHeaders = new Dictionary<string, string>
|
private readonly Dictionary<string, string> _apiHeaders = new Dictionary<string, string>
|
||||||
|
@ -149,6 +150,8 @@ namespace Jackett.Common.Indexers
|
||||||
public override async Task<byte[]> Download(Uri link)
|
public override async Task<byte[]> Download(Uri link)
|
||||||
{
|
{
|
||||||
var result = await RequestStringWithCookies(link.AbsoluteUri);
|
var result = await RequestStringWithCookies(link.AbsoluteUri);
|
||||||
|
if (SobrecargaUrl.Equals(result.RedirectingTo))
|
||||||
|
throw new Exception("El servidor se encuentra sobrecargado en estos momentos. / The server is currently overloaded.");
|
||||||
try {
|
try {
|
||||||
var parser = new HtmlParser();
|
var parser = new HtmlParser();
|
||||||
var doc = parser.ParseDocument(result.Content);
|
var doc = parser.ParseDocument(result.Content);
|
||||||
|
|
Loading…
Reference in New Issue