static void OverallTest() { var processor = new YoutubeApisProcessor(); var directory = new DirectoryInfo("."); processor.Authorize(directory); var videos = processor.GetAllClips(); foreach (var video in videos) { Console.WriteLine("{0,-15}{1,10}", video.Id, video.Name); } var v = videos.First(); processor.UpdateVideoThumbnail(v, new FileInfo("aiml.png")); return; v.Name = "XXX"; v.Description = "YYY"; processor.UpdateVideo(v); var lists = processor.GetAllPlaylists(); foreach (var list in lists) { Console.WriteLine("{0}", list.PlaylistTitle); processor.DeletePlaylist(list); } var newList = processor.CreatePlaylist("Test"); processor.FillPlaylist(newList, videos); }
static void OverallTest() { var processor = new YoutubeApisProcessor(); var directory = new DirectoryInfo("."); processor.Authorize(directory); var videos = processor.GetAllClips(); foreach (var video in videos) Console.WriteLine("{0,-15}{1,10}", video.Id, video.Name); var v = videos.First(); processor.UpdateVideoThumbnail(v, new FileInfo("aiml.png")); return; v.Name = "XXX"; v.Description = "YYY"; processor.UpdateVideo(v); var lists = processor.GetAllPlaylists(); foreach (var list in lists) { Console.WriteLine("{0}", list.PlaylistTitle); processor.DeletePlaylist(list); } var newList = processor.CreatePlaylist("Test"); processor.FillPlaylist(newList, videos); }
public override void Work() { if (YoutubeApisProcessor.Current == null) { YoutubeApisProcessor.Initialize(Model.Videotheque.TempFolder); } Action <int> percentageUpdate = (int percentage) => { Progress = Math.Min(100, percentage); }; var newId = YoutubeApisProcessor.Current.UploadVideo(pathToFile, episode.Name, episode.Guid, percentageUpdate); if (episode.YoutubeId != null) { YoutubeApisProcessor.Current.DeleteVideo(episode.YoutubeId); } episode.YoutubeId = newId; Model.Save(); }
public static void Main(string[] args) { if (args.Length == 0) { MessageBox.Show("This program should be called with an argument: the path to videotheque file"); return; } videotheque = Videotheque.Load(args[0], null, true); OpenModel("LHPS"); YoutubeApisProcessor.Initialize(videotheque.TempFolder); Application = new System.Windows.Application(); var viewModel = new MainViewModel(videotheque, publishingModel, () => SourcesFactory()); var window = new MainWindow(); window.DataContext = viewModel; Application.Run(window); }