tytd/Tesses.YouTubeDownloader/IDownloader.cs

44 lines
1.9 KiB
C#
Raw Permalink Normal View History

2022-04-06 16:41:29 +00:00
using System;
using YoutubeExplode;
using YoutubeExplode.Videos;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Net.Http;
using YoutubeExplode.Playlists;
using YoutubeExplode.Channels;
namespace Tesses.YouTubeDownloader
{
2022-06-24 23:02:51 +00:00
public interface IDownloader : IPersonalPlaylistSet
2022-04-06 16:41:29 +00:00
{
event EventHandler<VideoStartedEventArgs> VideoStarted;
event EventHandler<VideoProgressEventArgs> VideoProgress;
event EventHandler<VideoFinishedEventArgs> VideoFinished;
event EventHandler<TYTDErrorEventArgs> Error;
event EventHandler<BellEventArgs> Bell;
2022-08-28 21:40:34 +00:00
void CancelDownload(bool restart=false);
2022-04-06 16:41:29 +00:00
Task AddVideoAsync(VideoId id,Resolution resolution=Resolution.PreMuxed);
Task AddPlaylistAsync(PlaylistId id,Resolution resolution=Resolution.PreMuxed);
Task AddChannelAsync(ChannelId id,Resolution resolution=Resolution.PreMuxed);
Task AddHandleAsync(ChannelHandle handle,Resolution resolution=Resolution.PreMuxed);
Task AddSlugAsync(ChannelSlug handle,Resolution resolution=Resolution.PreMuxed);
2022-04-06 16:41:29 +00:00
Task AddUserAsync(UserName userName,Resolution resolution=Resolution.PreMuxed);
2022-07-06 22:59:50 +00:00
Task AddFileAsync(string url,bool download=true);
2022-04-06 16:41:29 +00:00
IReadOnlyList<(SavedVideo Video,Resolution Resolution)> GetQueueList();
SavedVideoProgress GetProgress();
2022-05-10 12:57:52 +00:00
IAsyncEnumerable<Subscription> GetSubscriptionsAsync();
Task UnsubscribeAsync(ChannelId id);
Task SubscribeAsync(ChannelId id,ChannelBellInfo bellInfo = ChannelBellInfo.NotifyAndDownload);
2022-05-10 12:57:52 +00:00
Task SubscribeAsync(UserName name,ChannelBellInfo info=ChannelBellInfo.NotifyAndDownload);
Task ResubscribeAsync(ChannelId id,ChannelBellInfo info=ChannelBellInfo.NotifyAndDownload);
2022-06-24 23:02:51 +00:00
void DeletePersonalPlaylist(string name);
2022-07-06 22:59:50 +00:00
2022-04-06 16:41:29 +00:00
}
}