mirror of
https://onedev.site.tesses.net/tytd2025
synced 2026-02-08 17:45:45 +00:00
Make subscriptions quicker
This commit is contained in:
@@ -952,7 +952,6 @@ class TYTD.Downloader {
|
||||
if(!notify && downloadRes == Resolution.NoDownload) continue;
|
||||
var cid = sub.channelId;
|
||||
|
||||
var newVideos = [];
|
||||
|
||||
each(var batch : this.QueryPlaylistItems($"UU{cid.Substring(2)}",false))
|
||||
{
|
||||
@@ -960,29 +959,27 @@ class TYTD.Downloader {
|
||||
{
|
||||
|
||||
if(this.GetVideo(videoId) == null)
|
||||
{
|
||||
newVideos.Add(videoId);
|
||||
}
|
||||
}
|
||||
|
||||
if(notify)
|
||||
{
|
||||
each(var id : newVideos)
|
||||
{
|
||||
this.PutVideoInfoIfNotExists(id);
|
||||
this.PutVideoInfoIfNotExists(videoId);
|
||||
var res = this.GetVideo(id);
|
||||
if(res != null)
|
||||
this.Bell.Invoke(this,{
|
||||
Video = res
|
||||
});
|
||||
}
|
||||
}
|
||||
if(downloadRes != Resolution.NoDownload)
|
||||
{
|
||||
each(var id : newVideos)
|
||||
{
|
||||
this.DownloadVideo(id,downloadRes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1570,14 +1567,9 @@ class TYTD.Downloader {
|
||||
var response = Net.Http.MakeRequest(url,requestData);
|
||||
if(response.StatusCode != 200) throw "Not success";
|
||||
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 data = Json.Decode(text);
|
||||
|
||||
|
||||
var cr = data.contents.twoColumnWatchNextResults.playlist.playlist;
|
||||
if(cr == null || cr == undefined)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user