public static void Main(string[] args) { CheLink("ftp://*****:*****@y153.dydytt.net:9186/[阳光电影www.ygdy8.com].28岁未成年.HD.720p.国语中字.mkv"); return; bool debug = false; if (debug) { List <Movie> mds = new List <Movie> { new Movie { Name = "A", Url = "http://ss.com", MovieType = MovieType.Film, DownloadInfos = new List <DownloadInfo> { new DownloadInfo { Title = "BD", Url = "http://dwasdf.com" } } } }; MovieSerialier mda = new MovieSerialier(mds, "movies.xml"); mda.ToXml(); Console.Read(); return; } FDCrawler fc = new Crawler.FDCrawler(); var movies = fc.GetRes("http://www.dytt8.net/index.html"); fc.CheckMovie(movies); //DD(movies[0]); MovieSerialier ms = new MovieSerialier(movies, "movies.xml"); ms.ToXml(); Console.Read(); }
static string DD(Movie movie) { try { FDCrawler fc = new Crawler.FDCrawler(); var movieHTML = fc.LoadData(movie.Url); if (string.IsNullOrEmpty(movieHTML)) { return(null); } var movieDoc = new HtmlParser().Parse(movieHTML); var zoom = movieDoc.GetElementById("Zoom"); var lstDownLoadURL = movieDoc.QuerySelectorAll("[bgcolor='#fdfddf']"); var updatetime = movieDoc.QuerySelector("span.updatetime"); var pubDate = DateTime.Now; if (updatetime != null && !string.IsNullOrEmpty(updatetime.InnerHtml)) { DateTime.TryParse(updatetime.InnerHtml.Replace("发布时间:", ""), out pubDate); } var lstOnlineURL = lstDownLoadURL.Select(a => a.QuerySelector("a")).Where(item => item != null).Select(item => item.InnerHtml).ToList(); var movieName = movieDoc.QuerySelector("div.title_all"); //var movieInfo = new MovieInfo() //{ // MovieName = movieName != null && movieName.QuerySelector("h1") != null ? // movieName.QuerySelector("h1").InnerHtml : "找不到影片信息...", // Dy2018OnlineUrl = onlineURL, // MovieIntro = zoom != null && isContainIntro ? WebUtility.HtmlEncode(zoom.InnerHtml) : "暂无介绍...", // XunLeiDownLoadURLList = lstOnlineURL, // PubDate = pubDate, //}; return(null);// movieInfo; } catch (Exception ex) { //LogHelper.Error("GetMovieInfoFromOnlineURL Exception", ex, new { OnloneURL = onlineURL }); return(null); } }