Fix thumbnail error

This commit is contained in:
2025-12-28 23:02:31 -06:00
parent 2626242fa1
commit 3cc23ff97d

View File

@@ -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)
{