Torna al Thread

using Google.GData.Client; using Google.GData.Extensions; using Google.GData.YouTube; using Google.GData.Extensions.MediaRss; using Google.YouTube; public class YouTube { #region Costanti static string URI_SINGLE_VIDEO = "https://gdata.youtube.com/feeds/api/users/" + Account + "/uploads/"; #endregion #region Costruttori public YouTube() { } #endregion Costruttori #region Proprietà static YouTubeRequestSettings settings = new YouTubeRequestSettings(Account, DeveloperKey, Username, Password); public static string Account { get { ... } } public static string Username { get { ... } } public static string Password { get { ... } } public static string DeveloperKey { get { ... } } public static string UserId { get { ... } } #endregion #region Metodi public static Video getVideo(string videoId) { YouTubeRequest request = new YouTubeRequest(settings); Uri videoEntryUrl = new Uri(URI_SINGLE_VIDEO + videoId); return request.Retrieve<Video>(videoEntryUrl); } static void Remove(Video video) { YouTubeRequest request = new YouTubeRequest(settings); request.Delete(video); } public static bool Elimina(string videoId) { try { if (!string.IsNullOrEmpty(videoId)) { Video video = getVideo(videoId); Remove(video); } } catch (Exception ex) { } return true; } #endregion }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5