private void GetPlaylist(string URL) { var process = new YoutubeDL(URL); Tracks.AddRange(process.GetData()); Close(); }
void GetPlaylist(String URL) { YoutubeDL process = new YoutubeDL(URL); Tracks.AddRange(process.GetData()); this.Close(); }
public List <Track> MakeTracksList(string URL) { var Array = new List <Track>(); var GroupID = Regex.Match(URL, @"v=([^&]*)").Groups; var GroupPlaylist = Regex.Match(URL, @"list=([^&]*)").Groups; var GroupUser = Regex.Match(URL, @"/user/([^/]*)/").Groups; var IsTrack = GroupID.Count > 1; var IsPlaylist = GroupPlaylist.Count > 1; var IsUser = GroupUser.Count > 1; if (IsTrack) { var YoutubeID = GroupID[1].Value; var track = new Track("", YoutubeID); track.MusicTab = this; Array.Add(track); } else if (IsPlaylist) { var Playlist = GroupPlaylist[1].Value; var youtube = new YoutubeDL(Playlist); Array.AddRange(youtube.GetData()); } else if (IsUser) { var User = GroupUser[1].Value; var youtube = new YoutubeDL("ytuser:" + User); Array.AddRange(youtube.GetData()); } return(Array); }
public static List <Track> MakeTracksList(string URL) { List <Track> Array = new List <Track>(); var GroupID = Regex.Match(URL, @"v=([^&]*)").Groups; var GroupPlaylist = Regex.Match(URL, @"list=([^&]*)").Groups; var GroupUser = Regex.Match(URL, @"/user/([^/]*)/").Groups; bool IsTrack = GroupID.Count > 1; bool IsPlaylist = GroupPlaylist.Count > 1; bool IsUser = GroupUser.Count > 1; if (IsTrack) { foreach (Group g in GroupID) { Debug.WriteLine(g.Value); } String YoutubeID = GroupID[1].Value; Track track = new Track("", "", YoutubeID); Array.Add(track); } else if (IsPlaylist) { String Playlist = GroupPlaylist[1].Value; YoutubeDL youtube = new YoutubeDL(Playlist); Array.AddRange(youtube.GetData()); } else if (IsUser) { String User = GroupUser[1].Value; YoutubeDL youtube = new YoutubeDL("ytuser:" + User); Array.AddRange(youtube.GetData()); } return(Array); }