Added file extension to downloaded Images.

This commit is contained in:
glax 2023-05-18 17:42:02 +02:00
parent 81f380dc3c
commit ada842957e

View File

@ -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");
}