Exemplo n.º 1
0
 public HttpResponseMessage Post(Movie movie)
 {
     if (movie.Url.ToLower().Contains("youtube"))
     {
         Uri    videoUri = new Uri(movie.Url);
         string videoID  = HttpUtility.ParseQueryString(videoUri.Query).Get("v");
         movie.Url = videoID;
     }
     try
     {
         var title       = Methods.GetYoutubeInfo(movie.Url, "title");
         var description = Methods.GetYoutubeInfo(movie.Url, "shortDescription");
     }
     catch (Exception e)
     {
         return(Methods.getHttpResponseMessage("{\"error\":\"Invalid Url\"}"));
     }
     QueryHelper.AddMovie(movie);
     return(Methods.getHttpResponseMessage(string.Empty));
 }