Example #1
0
        public void GetMTVDownloadInfo(MTVInfo mtv)
        {
            if (string.IsNullOrWhiteSpace(mtv.DetailUrl))
            {
                return;
            }
            WebClient client = new WebClient();
            string    html   = client.DownloadString(mtv.DetailUrl).Replace("\r\n", "").Replace("\n", "").Replace("\r", "");

            mtv.MTVImage = Regex.Match(html, "document.getElementById\\('bigimg'\\).src='.*?'", RegexOptions.IgnoreCase).Value.Replace("document.getElementById('bigimg').src='", "").Replace("'", "");
            mtv.ED2KUrl  = Regex.Match(html, "ed2k://\\|.*?\\|/", RegexOptions.IgnoreCase).Value;
            string mobileUrl  = Regex.Match(html, "<div class=\"jk_img fl\">.*?</div>", RegexOptions.IgnoreCase).Value.RemoveRegexStr("<div.*?href=\"").RemoveRegexStr("\">.*</div>");
            string mobileHtml = Encoding.UTF8.GetString(client.DownloadData(MTVDomain + mobileUrl)).Replace("\r\n", "").Replace("\n", "").Replace("\r", "");

            mtv.ServerUrl = Regex.Match(mobileHtml, "网盘下载</a>.*?<a href=.*?class=\"btn-dl-com\">普通下载</a>").Value.RemoveRegexStr("网盘下载</a>.*?<a href=\"").RemoveRegexStr("\".*</a>");
            string cloudDiskHtml = Regex.Match(mobileHtml, "<a rel.*?class=\"btn-dl-speed\">网盘下载</a>").Value.Replace("\" class=\"btn-dl-speed\">网盘下载</a>", "").RemoveRegexStr("<a rel.*?href=\"");
            string cloudHtml     = HTTPHelper.HttpGet(cloudDiskHtml, Encoding.UTF8).Replace("\r\n", "").Replace("\n", "").Replace("\r", "");
            //https://mvxzjl.ctfile.com/get_file_url.php?uid=12871846&fid=163660028&file_chk=2d661c736a0c7c4946ecf4f853352fc9
            string uid = Regex.Match(cloudHtml, "var userid = '.*?'").Value.Replace("var userid = '", "").Replace("'", "");

            //free_down('163660028', 0, '2d661c736a0c7c4946ecf4f853352fc9', 0, 0)
            string[]     pt             = Regex.Match(cloudHtml, "free_down\\(.*?0\\)").Value.Replace("free_down(", "").Replace(")", "").Replace("'", "").Replace(" ", "").Split(',');
            string       fid            = pt[0];
            string       file_chk       = pt[2];
            string       getDownloadUrl = $"https://mvxzjl.ctfile.com/get_file_url.php?uid={uid}&fid={fid}&file_chk={file_chk}";
            string       downloadurl    = client.DownloadString(getDownloadUrl).Replace("\\/", "/");
            DownlaodJson json           = JsonConvert.DeserializeObject <DownlaodJson>(downloadurl);

            mtv.CloudDiskUrl = json.downurl;
        }