public Song(string file) { if (StringNetworkTools.IsURL(file)) { //Setup MP3 IDv1 TAG Reader //First we get our MP3TAG from remote file byte[] id3data = WebRequester.Request(file, null, null, 128); this._ID3 = new ID3(id3data); if (_ID3.hasTag) { this.mp3tag = _ID3; this.Name = $"{mp3tag.Artist} - {mp3tag.Title}"; } else { string href = StringNetworkTools.FileFromURL(file); this.Name = href.Split('.')[0]; } this.URL = file; } else { this.Name = file.Split('.')[0]; this.URL = file; this.mp3tag = null; } }
static void Main(string[] args) { byte[] test = WebRequester.Request("http://tv2.partizan.si/YoutubeVideoPlayer/api/audio/song2.mp3", null, null, 128); ID3 tag = new ID3(test); Console.WriteLine("Tag is available: " + tag.hasTag); Console.WriteLine("Artist: " + tag.Artist); Console.WriteLine("Title: " + tag.Title); Console.ReadLine(); }
public void DoWork() { Object obj = MakeObject(); int status = webRequester.Request(obj); if (status == 200) { Console.WriteLine("OK"); } else { Console.WriteLine("Not OK"); } }
private static async Task <byte[]> DoDownloadImage(string url, ProxyInfo proxyInfo) { var imageBytes = await WebRequester.Request(url, proxyInfo); return(ResizeImage(imageBytes)); }