wrap in try

This commit is contained in:
Demetria Lovato 2021-06-25 20:17:59 -07:00
parent 7b67eef692
commit 4b4db4fbff
7 changed files with 13 additions and 6 deletions

Binary file not shown.

View File

@ -82,11 +82,18 @@ namespace youtube_downloader.Server.Functions
}
if (canAdd)
{
var items = await item.DownloadData();
if(item.DownloadActualDataAfterwards)
try
{
_DownloadVideos(items);
}
var items = await item.DownloadData();
if (item.DownloadActualDataAfterwards)
{
_DownloadVideos(items);
}
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
_ = ex;
}
}
} while (true);
}

View File

@ -87,12 +87,12 @@ namespace youtube_downloader.Server.Models
return new SavedVideoObject[] { sv };
}
case InfoType.Playlist:
{
{ List<SavedVideoObject> video2 = new List<SavedVideoObject>();
List<string> vo = new List<string>();
SavedPlaylist pl = await SavedPlaylist.FromPlaylistId(res, Functions.Downloader.DL.ytc, Data, (e,f) => { vo.Add(e); }, Functions.Downloader.DL._DownloadThumbnail);
string infpath = Functions.Downloader.DL.GetPath(true, "Playlist", Data + ".json");
File.WriteAllText(infpath, JsonConvert.SerializeObject(pl));
List<SavedVideoObject> video2 = new List<SavedVideoObject>();
foreach(var str in vo)
{
string infPath = Functions.Downloader.DL.GetPath(true, "Info", str + ".json");

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.