2022-06-14 18:21:36 +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 System.IO;
|
|
|
|
using YoutubeExplode.Playlists;
|
|
|
|
using YoutubeExplode.Channels;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace Tesses.YouTubeDownloader
|
|
|
|
{
|
|
|
|
public interface IStorage : IWritable, IDownloader, ITYTDBase
|
|
|
|
{
|
2022-07-06 22:59:50 +00:00
|
|
|
Task WriteBestStreamInfoAsync(VideoId id,BestStreamInfo.BestStreamsSerialized serialized);
|
2022-06-14 18:21:36 +00:00
|
|
|
Task<bool> MuxVideosAsync(SavedVideo video,string videoSrc,string audioSrc,string videoDest,IProgress<double> progress=null,CancellationToken token=default(CancellationToken));
|
|
|
|
Task<bool> Continue(string path);
|
|
|
|
Task WriteVideoInfoAsync(SavedVideo channel);
|
|
|
|
Task WritePlaylistInfoAsync(SavedPlaylist channel);
|
|
|
|
Task WriteChannelInfoAsync(SavedChannel channel);
|
|
|
|
void CreateDirectoryIfNotExist(string path);
|
|
|
|
LegacyConverter Legacy {get;}
|
|
|
|
Logger GetLogger();
|
|
|
|
LoggerProperties GetLoggerProperties();
|
|
|
|
IReadOnlyList<Subscription> GetLoadedSubscriptions();
|
|
|
|
event EventHandler<BellEventArgs> Bell;
|
|
|
|
event EventHandler<VideoStartedEventArgs> VideoStarted;
|
|
|
|
|
|
|
|
event EventHandler<BeforeSaveInfoEventArgs> BeforeSaveInfo;
|
|
|
|
|
|
|
|
event EventHandler<VideoProgressEventArgs> VideoProgress;
|
|
|
|
|
|
|
|
public event EventHandler<VideoFinishedEventArgs> VideoFinished;
|
|
|
|
bool CanDownload {get;set;}
|
|
|
|
IExtensionContext ExtensionContext {get;set;}
|
|
|
|
HttpClient HttpClient {get;set;}
|
|
|
|
YoutubeClient YoutubeClient {get;set;}
|
|
|
|
Task<Stream> OpenOrCreateAsync(string path);
|
|
|
|
|
|
|
|
void RenameFile(string src, string dest);
|
|
|
|
|
|
|
|
Task<Stream> CreateAsync(string path);
|
|
|
|
void Unsubscribe(ChannelId id);
|
|
|
|
void CreateDirectory(string path);
|
|
|
|
|
|
|
|
void MoveDirectory(string src, string dest);
|
|
|
|
|
|
|
|
void DeleteFile(string file);
|
|
|
|
|
|
|
|
void DeleteDirectory(string dir, bool recursive = false);
|
|
|
|
Task<bool> DownloadVideoOnlyAsync(SavedVideo video,CancellationToken token,IProgress<double> progress,bool report=true);
|
|
|
|
Task MoveLegacyStreams(SavedVideo video,BestStreams streams);
|
|
|
|
|
2022-06-15 08:04:26 +00:00
|
|
|
void StartLoop(CancellationToken token=default(CancellationToken));
|
2022-06-24 23:02:51 +00:00
|
|
|
event EventHandler<TYTDErrorEventArgs> Error;
|
2022-06-14 18:21:36 +00:00
|
|
|
}
|
|
|
|
}
|