From 3cc23ff97dab5a1990c7a67c2a5dd9d2786f91f7 Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Sun, 28 Dec 2025 23:02:31 -0600 Subject: [PATCH] Fix thumbnail error --- Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross b/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross index 8e45ae2..f95662d 100644 --- a/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross +++ b/Tesses.YouTubeDownloader/src/YouTubeDownloader.tcross @@ -1569,7 +1569,15 @@ class TYTD.Downloader { this.RateLimit(); var response = Net.Http.MakeRequest(url,requestData); if(response.StatusCode != 200) throw "Not success"; - var data = Json.Decode(response.ReadAsString()); + const text = response.ReadAsString(); + var data = {}; + try { + data = Json.Decode(text); + } catch(ex) { + this.Storage.CreateDirectory(/"CorruptedJson"); + FS.WriteAllText(this.Storage,/"CorruptedJson"/$"{DateTime.NowEpoch}.json", text); + throw ex; + } var cr = data.contents.twoColumnWatchNextResults.playlist.playlist; if(cr == null || cr == undefined) {