mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-21 13:43:01 +02:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using System.Net;
|
|
using HtmlAgilityPack;
|
|
|
|
namespace API.MangaDownloadClients;
|
|
|
|
public struct RequestResult
|
|
{
|
|
public HttpStatusCode statusCode { get; }
|
|
public Stream result { get; }
|
|
public bool hasBeenRedirected { get; }
|
|
public string? redirectedToUrl { get; }
|
|
public HtmlDocument? htmlDocument { get; }
|
|
|
|
public RequestResult(HttpStatusCode statusCode, HtmlDocument? htmlDocument, Stream result)
|
|
{
|
|
this.statusCode = statusCode;
|
|
this.htmlDocument = htmlDocument;
|
|
this.result = result;
|
|
}
|
|
|
|
public RequestResult(HttpStatusCode statusCode, HtmlDocument? htmlDocument, Stream result, bool hasBeenRedirected, string redirectedTo)
|
|
: this(statusCode, htmlDocument, result)
|
|
{
|
|
this.hasBeenRedirected = hasBeenRedirected;
|
|
redirectedToUrl = redirectedTo;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return
|
|
$"{(int)statusCode} {statusCode.ToString()} {(hasBeenRedirected ? "Redirected: " : "")} {redirectedToUrl}";
|
|
}
|
|
} |