add thumbnail download to downloader
This commit is contained in:
parent
6760089173
commit
54f9a14c9a
Binary file not shown.
|
@ -502,9 +502,30 @@ namespace youtube_downloader.Server.Functions
|
||||||
List<SavedMedia> media = new List<SavedMedia>();
|
List<SavedMedia> media = new List<SavedMedia>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await DL.ytc.Search.GetVideosAsync(text).ForEachAsync((e) => { media.Add(new SavedMedia() { Title = e.Title, Id = e.Id, Kind = InfoType.Video }); });
|
await DL.ytc.Search.GetVideosAsync(text).ForEachAsync((e) => {
|
||||||
await DL.ytc.Search.GetPlaylistsAsync(text).ForEachAsync((e) => { media.Add(new SavedMedia() { Title = e.Title, Id = e.Id, Kind = InfoType.Playlist }); });
|
foreach(var t in e.Thumbnails)
|
||||||
await DL.ytc.Search.GetChannelsAsync(text).ForEachAsync((e) => { media.Add(new SavedMedia() { Title = e.Title, Id = e.Id, Kind = InfoType.Channel }); });
|
{
|
||||||
|
DL._DownloadThumbnail(t.Resolution.Width, t.Resolution.Height, e.Id, t.Url);
|
||||||
|
}
|
||||||
|
media.Add(new SavedMedia() {Title = e.Title, Id = e.Id, Kind = InfoType.Video });
|
||||||
|
|
||||||
|
});
|
||||||
|
await DL.ytc.Search.GetPlaylistsAsync(text).ForEachAsync((e) => {
|
||||||
|
foreach (var t in e.Thumbnails)
|
||||||
|
{
|
||||||
|
DL._DownloadThumbnail(t.Resolution.Width, t.Resolution.Height, e.Id, t.Url);
|
||||||
|
}
|
||||||
|
media.Add(new SavedMedia() { Title = e.Title, Id = e.Id, Kind = InfoType.Playlist });
|
||||||
|
|
||||||
|
});
|
||||||
|
await DL.ytc.Search.GetChannelsAsync(text).ForEachAsync((e) => {
|
||||||
|
foreach (var t in e.Thumbnails)
|
||||||
|
{
|
||||||
|
DL._DownloadThumbnail(t.Resolution.Width, t.Resolution.Height, e.Id, t.Url);
|
||||||
|
}
|
||||||
|
media.Add(new SavedMedia() { Title = e.Title, Id = e.Id, Kind = InfoType.Channel });
|
||||||
|
|
||||||
|
});
|
||||||
}catch (Exception ex)
|
}catch (Exception ex)
|
||||||
{
|
{
|
||||||
_ = ex;
|
_ = ex;
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue