private void btnApply_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtSpotify.Text) || string.IsNullOrEmpty(txtYoutube.Text)) { MessageBox.Show(this, "Both fields need to be set with valid links", "Incomplete Fields"); } else { string YTID = YoutubeHeleprs.GetVideoID(txtYoutube.Text); string SPID = MainWindow.Instance.Client.ExtractSpotifyID(txtSpotify.Text); this.ClosePopup(); OnManualResolveFinished(SPID, YTID); } }
public async Task <MusixSongResult> Collect(string VideoURL) { Console.WriteLine("get id"); var video = await YouTube.Videos.GetAsync(YoutubeHeleprs.GetVideoID(VideoURL)); MusixSongResult Result = new MusixSongResult(); Console.WriteLine("run extrap"); ExtrapResult Extrap = DetailsExtrapolator.ExtrapolateDetails(video.Title); Result.Extrap = Extrap; FullTrack Track = FindTrack(Extrap, (video.Duration.HasValue ? video.Duration.Value : TimeSpan.Zero), 5000); Result.HasLyrics = false; Result.SpotifyTrack = Track; Result.YoutubeVideo = video; Console.WriteLine("ret."); return(Result); }
public async Task <MusixSongResult> CollectAsync(string VideoURL) { string ID = YoutubeHeleprs.GetVideoID(VideoURL); Console.WriteLine($"VID: {ID}"); Video video = await YouTube.Videos.GetAsync(ID); MusixSongResult Result = new MusixSongResult(); Console.WriteLine("run extrap"); ExtrapResult Extrap = DetailsExtrapolator.ExtrapolateDetails(video.Title); Result.Extrap = Extrap; FullTrack Track = FindTrack(Extrap, video.Duration, 5000); Result.HasLyrics = false; Result.SpotifyTrack = Track; Result.YoutubeVideo = video; Console.WriteLine("ret."); return(Result); }
public MusixSongResult Collect(string VideoURL) { Console.WriteLine("get id"); var GetVid = YouTube.Videos.GetAsync(YoutubeHeleprs.GetVideoID(VideoURL)); Console.WriteLine("get wait"); GetVid.Wait(); Console.WriteLine("got vid"); Video video = GetVid.Result; MusixSongResult Result = new MusixSongResult(); Console.WriteLine("run extrap"); ExtrapResult Extrap = DetailsExtrapolator.ExtrapolateDetails(video.Title); Result.Extrap = Extrap; FullTrack Track = FindTrack(Extrap, video.Duration, 5000); Result.HasLyrics = false; Result.SpotifyTrack = Track; Result.YoutubeVideo = video; Console.WriteLine("ret."); return(Result); }
public async Task <Video> GetVideoByURL(string URL) { return(await YouTube.Videos.GetAsync(YoutubeHeleprs.GetVideoID(URL))); }