mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 05:09:49 +02:00
More logging
This commit is contained in:
@@ -28,6 +28,7 @@ public class MangaPark : MangaConnector
|
||||
|
||||
private (Manga, MangaConnectorId<Manga>)[]? SearchMangaWithDomain(string mangaSearchName, string domain)
|
||||
{
|
||||
Log.Debug($"Using domain {domain}");
|
||||
Uri baseUri = new($"https://{domain}/");
|
||||
|
||||
List<(Manga, MangaConnectorId<Manga>)> ret = [];
|
||||
@@ -68,6 +69,7 @@ public class MangaPark : MangaConnector
|
||||
|
||||
private (Manga, MangaConnectorId<Manga>)? GetMangaFromIdWithDomain(string mangaIdOnSite, string domain)
|
||||
{
|
||||
Log.Debug($"Using domain {domain}");
|
||||
Uri baseUri = new ($"https://{domain}/");
|
||||
return GetMangaFromUrl(new Uri(baseUri, $"title/{mangaIdOnSite}").ToString());
|
||||
}
|
||||
@@ -140,6 +142,7 @@ public class MangaPark : MangaConnector
|
||||
|
||||
private (Chapter, MangaConnectorId<Chapter>)[]? GetChaptersFromDomain(MangaConnectorId<Manga> mangaId, string domain)
|
||||
{
|
||||
Log.Debug($"Using domain {domain}");
|
||||
Uri baseUri = new ($"https://{domain}/");
|
||||
Uri requestUri = new (baseUri, $"title/{mangaId.IdOnConnectorSite}");
|
||||
|
||||
@@ -217,6 +220,7 @@ public class MangaPark : MangaConnector
|
||||
|
||||
private string[]? GetChapterImageUrlsFromDomain(MangaConnectorId<Chapter> chapterId, string domain)
|
||||
{
|
||||
Log.Debug($"Using domain {domain}");
|
||||
Uri baseUri = new ($"https://{domain}/");
|
||||
Uri requestUri = new (baseUri, $"title/{chapterId.IdOnConnectorSite}");
|
||||
if (downloadClient.MakeRequest(requestUri.ToString(), RequestType.Default) is
|
||||
|
@@ -36,9 +36,12 @@ public abstract class DownloadClient
|
||||
|
||||
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(now.Subtract(LastExecutedRateLimit[requestType]));
|
||||
Log.Debug($"Request limit {requestType} {rateLimit}/Minute timeBetweenRequests: {timeBetweenRequests:ss'.'fffff} Timeout: {rateLimitTimeout:ss'.'fffff}");
|
||||
|
||||
|
||||
if (rateLimitTimeout > TimeSpan.Zero)
|
||||
{
|
||||
Log.Info($"Waiting {rateLimitTimeout} for {url}");
|
||||
Thread.Sleep(rateLimitTimeout);
|
||||
}
|
||||
|
||||
// Make the request
|
||||
RequestResult result = MakeRequestInternal(url, referrer, clickButton);
|
||||
|
@@ -8,6 +8,7 @@ internal class HttpDownloadClient : DownloadClient
|
||||
private static readonly FlareSolverrDownloadClient FlareSolverrDownloadClient = new();
|
||||
internal override RequestResult MakeRequestInternal(string url, string? referrer = null, string? clickButton = null)
|
||||
{
|
||||
Log.Debug($"Using {typeof(HttpDownloadClient).FullName} for {url}");
|
||||
if (clickButton is not null)
|
||||
Log.Warn("Client can not click button");
|
||||
HttpClient client = new();
|
||||
|
Reference in New Issue
Block a user