public static void AddToCrawl(YouTubeLink link) { var path = "watch?v=" + link.Path; var yt = new YouTube(path); Crawler.RegisterSite(yt); }
public async Task <IActionResult> PutYouTubeLink(int id, YouTubeLink youTubeLink) { if (id != youTubeLink.Id) { return(BadRequest()); } _context.Entry(youTubeLink).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!YouTubeLinkExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <YouTubeLink> > PostYouTubeLink(YouTubeLink youTubeLink) { // _context.Links.Add(youTubeLink); // await _context.SaveChangesAsync(); CrawlerManager.AddToCrawl(youTubeLink); return(CreatedAtAction(nameof(GetYouTubeLink), new { id = youTubeLink.Id }, youTubeLink)); }
/// <summary> /// Opens the song at YouTube.com in a new tab /// </summary> public static void GoToYouTube() { YouTubeLink.Click(); }