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,10 +82,17 @@ namespace youtube_downloader.Server.Functions
} }
if (canAdd) if (canAdd)
{ {
var items = await item.DownloadData(); try
if(item.DownloadActualDataAfterwards)
{ {
_DownloadVideos(items); var items = await item.DownloadData();
if (item.DownloadActualDataAfterwards)
{
_DownloadVideos(items);
}
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
_ = ex;
} }
} }
} while (true); } while (true);

View File

@ -87,12 +87,12 @@ namespace youtube_downloader.Server.Models
return new SavedVideoObject[] { sv }; return new SavedVideoObject[] { sv };
} }
case InfoType.Playlist: case InfoType.Playlist:
{ { List<SavedVideoObject> video2 = new List<SavedVideoObject>();
List<string> vo = new List<string>(); 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); 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"); string infpath = Functions.Downloader.DL.GetPath(true, "Playlist", Data + ".json");
File.WriteAllText(infpath, JsonConvert.SerializeObject(pl)); File.WriteAllText(infpath, JsonConvert.SerializeObject(pl));
List<SavedVideoObject> video2 = new List<SavedVideoObject>();
foreach(var str in vo) foreach(var str in vo)
{ {
string infPath = Functions.Downloader.DL.GetPath(true, "Info", str + ".json"); 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.