From ada842957eccfbc5a62b5899c8a80eb3a3dc9252 Mon Sep 17 00:00:00 2001 From: glax <--local> Date: Thu, 18 May 2023 17:42:02 +0200 Subject: [PATCH] Added file extension to downloaded Images. --- Tranga/Connector.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tranga/Connector.cs b/Tranga/Connector.cs index 2012ad2..49000e2 100644 --- a/Tranga/Connector.cs +++ b/Tranga/Connector.cs @@ -19,8 +19,13 @@ public abstract class Connector Directory.CreateDirectory(tempFolder); int chapter = 0; - foreach(string imageUrl in imageUrls) - DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}")); + foreach (string imageUrl in imageUrls) + { + string[] split = imageUrl.Split('.'); + string extension = split[split.Length - 1]; + DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}.{extension}")); + + } ZipFile.CreateFromDirectory(tempFolder, $"{outputFolderPath}.cbz"); }