示例#1
0
        public static string get_validationUrl(string shareId)
        {
            /// 直接GET请求 https://www.lanzous.com/tp/ID 提取直连,此时需要UA设置为手机,PC版无法提取此链接
            /// 手机端返回的html中有一段js暴露了服务器IP和相关参数
            var            url = "https://www.lanzous.com/tp/" + shareId;
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);

            /// <script type="text/javascript">
            /// var urlpt = 'http://120.55.32.134/file/';   # 这个是IP
            ///     (function(document) {
            /// var submit = document.getElementById('submit');
            ///         //var urlpt = 'http://120.55.32.134/file/';
            /// submit.onfocus = submit.onmousedown = function() {
            /// submit.href = urlpt + "XXXXXXXXXXX"  # 这个是参数
            ///     }})(document);
            /// </script>
            req.UserAgent = phoneUserAgent;
            var hdoc      = Example_Work.Get(req);
            var hostMatch = Regex.Match(hdoc, @"\nvar dpost = '(.*?)';");
            var host      = hostMatch.Groups[1].Value;
            var href      = Regex.Match(hdoc, @"submit.href = dpost \+ ""(.*?)""").Groups[1].Value;

            var temp_url = host + href;

            return(temp_url);
        }
示例#2
0
        public string get_shareId(int fid)
        {
            //fid = "11769053";
            var            lanz = "https://pc.woozooo.com/doupload.php";
            HttpWebRequest req  = (HttpWebRequest)WebRequest.Create(lanz);

            req.CookieContainer = cookieBag;
            //req.UserAgent = phoneUserAgent;
            var data = new Dictionary <string, string>();

            data["task"]    = "22";
            data["file_id"] = fid.ToString();
            var retJson = Newtonsoft.Json.Linq.JObject.Parse(Example_Work.Post(req, data));

            if (retJson["zt"].ToObject <int>() != 1)
            {
                return(null);
            }
            return(retJson["info"]["f_id"].ToString());
        }
示例#3
0
        public bool login(string name, string password)
        {
            var loginUrl = "https://pc.woozooo.com/account.php";
            var data     = new Dictionary <string, string>();

            data["action"]   = "login";
            data["task"]     = "login";
            data["ref"]      = "https://up.woozooo.com/";
            data["formhash"] = "0af1aa15";
            data["username"] = "******";
            data["password"] = "******";
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(loginUrl);

            req.CookieContainer = cookieBag;
            var hdoc = Example_Work.Post(req, data);

            isLogin = hdoc.Contains("登录成功");

            HttpClientHandler hander = new HttpClientHandler()
            {
                CookieContainer   = cookieBag,
                AllowAutoRedirect = true,
                UseCookies        = true
            };

            _hc = new HttpClient(hander);
            return(isLogin);

            //var hr = (HttpWebRequest)WebRequest.Create(loginUrl);
            //hr.Referer = "https://www.lanzous.com";
            //hr.Headers.Add(HttpRequestHeader.AcceptLanguage, "zh-cn,en-us;q=0.5");
            //hr.UserAgent = phoneUserAgent;
            //hr

            //var fid = "i5ydxrc";
            //var lanz = "https://www.lanzous.com/tp/";
        }