public static async Task GetOneVideo(string avideoPageUrl) { var data = await VideoHelpers.GetVideoUrlFormVideoPage(avideoPageUrl); var videoTitle = data.Item1; var videoUrl = data.Item2; var subdir = Path.Combine(Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Video"), videoTitle); if (!Directory.Exists(subdir)) { Directory.CreateDirectory(subdir); } var arr = videoUrl?.Split('/'); if (arr?.Length > 2) { int notfoundcount = 0; if (int.TryParse(arr[5], out int code)) //4352680 { for (int i = 0; i < 300; i++) { if (notfoundcount >= 5) { //break; //nothing to do } else { string Afragment = code.ToString() + i.ToString(); // A fragment 一个片段 var url = @$ "https://cdn.91p07.com//m3u8/{code}/{Afragment}.ts"; var savepath = @$ "{subdir}\{Afragment}.ts"; //保存目录
private static async Task TestFunction2() { var videosData = await VideoHelpers.GetVideoInfo("https://www.91porn.com/index.php"); videosData.Reverse(); for (int i = 0; i < videosData.Count; i++) { await VideoHelpers.GetOneVideo(videosData[i].PageUrl); } }
private static async Task TestFunction1(string avideoPageUrl) { await VideoHelpers.GetOneVideo(avideoPageUrl); }