Fix MangaDex Downloads: Get Chapter-Id from URL

This commit is contained in:
Glax 2025-03-03 21:11:21 +01:00
parent 68cc23e158
commit d257095885

View File

@ -256,8 +256,11 @@ public class MangaDex : MangaConnector
internal override string[] GetChapterImageUrls(Chapter chapter) internal override string[] GetChapterImageUrls(Chapter chapter)
{//Request URLs for Chapter-Images {//Request URLs for Chapter-Images
Match m = Regex.Match(chapter.Url, @"https?:\/\/mangadex.org\/chapter\/([0-9\-a-z]+)");
if (!m.Success)
return [];
RequestResult requestResult = RequestResult requestResult =
downloadClient.MakeRequest($"https://api.mangadex.org/at-home/server/{chapter.ChapterId}?forcePort443=false", RequestType.MangaDexImage); downloadClient.MakeRequest($"https://api.mangadex.org/at-home/server/{m.Groups[1].Value}?forcePort443=false", RequestType.MangaDexImage);
if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300) if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300)
{ {
return []; return [];