From fafcdac00aa26c1f14d786e5d6d230ebfd8f9b13 Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 10 Oct 2023 22:40:07 +0200 Subject: [PATCH] Fix file-extension on image download --- Tranga/MangaConnectors/MangaConnector.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tranga/MangaConnectors/MangaConnector.cs b/Tranga/MangaConnectors/MangaConnector.cs index 5610eaf..cd42d3e 100644 --- a/Tranga/MangaConnectors/MangaConnector.cs +++ b/Tranga/MangaConnectors/MangaConnector.cs @@ -213,8 +213,7 @@ public abstract class MangaConnector : GlobalBase //Download all Images to temporary Folder foreach (string imageUrl in imageUrls) { - string[] split = imageUrl.Split('.'); - string extension = split[^1]; + string extension = imageUrl.Split('.')[^1].Split('?')[0]; Log($"Downloading image {chapter + 1:000}/{imageUrls.Length:000}"); //TODO HttpStatusCode status = DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}.{extension}"), requestType, referrer); Log($"{saveArchiveFilePath} {chapter + 1:000}/{imageUrls.Length:000} {status}");