Example #1
0
 protected override void ModifyRequest(HttpRequestItem req)
 {
     req.AddQueryValue("tuin", _friend.Uin);
     req.AddQueryValue("vfwebqq", Session.Vfwebqq);
     req.AddQueryValue("t", Timestamp);
     req.Referrer = ApiUrls.ReferrerS;
 }
        protected override HttpRequestItem BuildRequest()
        {
            var url = Session.SyncUrl;

            if (Session.SyncUrl == null)
            {
                var host = ApiUrls.SyncHosts[_hostIndex];
                url = $"https://{host}/cgi-bin/mmwebwx-bin/synccheck";
                Logger.LogDebug($"测试站点{_hostIndex + 1}: {host}");
            }
            else
            {
                Logger.LogInformation("Begin SyncCheck...");
            }
            var req = new HttpRequestItem(HttpMethodType.Get, url)
            {
                // 此处需要将key都变成小写,否则提交会失败
                StringData = Session.BaseRequest.ToDictionary(pair => pair.Key.ToLower(), pair => pair.Value).ToQueryString(),
            };

            req.AddQueryValue("r", Timestamp);
            req.AddQueryValue("synckey", Session.SyncKeyStr);
            req.AddQueryValue("_", Session.Seq++);

            return(req);
        }
Example #3
0
        public override HttpRequestItem BuildRequest()
        {
            HttpRequestItem req = null;

            // req.AddQueryValue("tuin", _friend.Uin);
            req.AddQueryValue("vfwebqq", Session.Vfwebqq);
            req.AddQueryValue("t", Timestamp);
            return(req);
        }
        protected override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Post, string.Format(ApiUrls.GetQRCode, Session.Uuid));

            req.AddQueryValue("t", "webwx");
            req.AddQueryValue("_", Session.Seq++);
            req.ResultType = HttpResultType.Stream;
            return(req);
        }
 protected override void ModifyRequest(HttpRequestItem req)
 {
     req.AddQueryValue("clientid", Session.ClientId);
     req.AddQueryValue("psessionid", Session.SessionId);
     req.AddQueryValue("vfwebqq", Session.Vfwebqq);
     req.AddQueryValue("t", Timestamp);
     req.AddQueryValue("did", _discussion.Did);
     req.Referrer = ApiUrls.Referrer;
 }
Example #6
0
        public override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Post, ApiUrls.CheckQRCode);

            req.AddQueryValue("tip", _tip);
            req.AddQueryValue("uuid", Session.Uuid);
            req.AddQueryValue("_", Session.Seq++);
            return(req);
        }
Example #7
0
        protected override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Post, ApiUrls.GetUuid);

            req.AddQueryValue("appid", ApiUrls.Appid);
            req.AddQueryValue("fun", "new");
            req.AddQueryValue("lang", "zh_CN");
            req.AddQueryValue("_", Session.Seq++);
            return(req);
        }
        protected override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Post, ApiUrls.CheckQRCode);

            req.AddQueryValue("loginicon", "true");
            req.AddQueryValue("tip", _tip);
            req.AddQueryValue("uuid", Session.Uuid);
            req.AddQueryValue("r", ~Timestamp);
            req.AddQueryValue("_", Session.Seq++);
            return(req);
        }
Example #9
0
        protected override void ModifyRequest(HttpRequestItem req)
        {
            req.Method = HttpMethodType.Post;
            var json = new JObject
            {
                { "clientid", Session.ClientId },
                { "psessionid", Session.SessionId },
                { "key", "" },
                { "ptwebqq", Session.Ptwebqq }
            };

            req.AddQueryValue("r", json.ToSimpleString());
            req.Referrer = "https://d1.web2.qq.com/cfproxy.html?v=20151105001&callback=1";
        }
Example #10
0
        protected override void ModifyRequest(HttpRequestItem req)
        {
            req.Method = HttpMethodType.Post;
            var json = new JObject
            {
                { "status", QQStatusType.Online.ToLowerString() },
                { "ptwebqq", Session.Ptwebqq },
                { "clientid", Session.ClientId },
                { "psessionid", "" }
            };

            req.AddQueryValue("r", json.ToSimpleString());
            req.Referrer = ApiUrls.Referrer;
        }
Example #11
0
        protected override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Get, ApiUrls.GetQRCode);

            req.AddQueryValue("appid", AppId);
            req.AddQueryValue("e", "0");
            req.AddQueryValue("l", "M");
            req.AddQueryValue("s", "5");
            req.AddQueryValue("d", "72");
            req.AddQueryValue("v", "4");
            req.AddQueryValue("t", new Random().NextDouble());
            req.ResultType = HttpResultType.Stream;
            return(req);
        }
Example #12
0
        public override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Get, ApiUrls.GetQRCode);

            req.AddQueryValue("appid", QQConstants.APPID);
            req.AddQueryValue("e", "0");
            req.AddQueryValue("l", "M");
            req.AddQueryValue("s", "5");
            req.AddQueryValue("d", "72");
            req.AddQueryValue("v", "4");
            req.AddQueryValue("t", new Random().NextDouble());
            //req.AddRefer(QQConstants.URL_LOGIN_PAGE);
            //req.AddHeader(HttpConstants.SetCookie, "qrsig=dG0lVGD8IhpDl1cMsy4qgghLk24rOwSK9YVq2YlWAjBzJ69tIE-9sFkMttULkrww; PATH=/; DOMAIN=ptlogin2.qq.com;");
            req.ResultType = HttpResultType.Stream;
            return(req);
        }
Example #13
0
        protected override HttpRequestItem BuildRequest()
        {
            HttpRequestItem req  = null;
            var             json = new JObject()
            {
                ["content"]    = _msg.PackContentList(),
                ["msg_id"]     = Interlocked.Increment(ref _msgId),
                ["clientid"]   = Session.ClientId,
                ["psessionid"] = Session.SessionId,
            };

            json.Add("face", 252); // 不知道有什么卵用

            switch (_msg)
            {
            case FriendMessage fMsg:
                /*
                 *  {
                 *     "to": 3269846909,
                 *     "content": "[\"嗯\",[\"font\",{\"name\":\"宋体\",\"size\":10,\"style\":[0,0,0],\"color\":\"000000\"}]]",
                 *     "face": 252,
                 *     "clientid": 53999199,
                 *     "msg_id": 22700002,
                 *     "psessionid": "8368046764001d636f6e6e7365727665725f77656271714031302e3133332e34312e383400001ad00000066b026e040015808a206d0000000a406172314338344a69526d0000002859185d94e66218548d1ecb1a12513c86126b3afb97a3c2955b1070324790733ddb059ab166de6857"
                 * }
                 */
                json.Add("to", fMsg.Friend.Uin);
                req = HttpRequestItem.CreateFormRequest(ApiUrls.SendFriendMsg);
                break;

            case GroupMessage gMsg:
                /*
                 *  {
                 *      "group_uin": 95198668,
                 *      "content": "[\"有人没\",[\"font\",{\"name\":\"宋体\",\"size\":10,\"style\":[0,0,0],\"color\":\"000000\"}]]",
                 *      "face": 252,
                 *      "clientid": 53999199,
                 *      "msg_id": 22700001,
                 *      "psessionid": "8368046764001d636f6e6e7365727665725f77656271714031302e3133332e34312e383400001ad00000066b026e040015808a206d0000000a406172314338344a69526d0000002859185d94e66218548d1ecb1a12513c86126b3afb97a3c2955b1070324790733ddb059ab166de6857"
                 *  }
                 */
                req = HttpRequestItem.CreateFormRequest(ApiUrls.SendGroupMsg);
                json.Add("group_uin", gMsg.Group.Gid);
                break;

            case DiscussionMessage dMsg:
                /*
                 *  {
                 *      "did": 800220077,
                 *      "content": "[\"asdf\",[\"font\",{\"name\":\"宋体\",\"size\":10,\"style\":[0,0,0],\"color\":\"000000\"}]]",
                 *      "face": 252,
                 *      "clientid": 53999199,
                 *      "msg_id": 22700003,
                 *      "psessionid": "8368046764001d636f6e6e7365727665725f77656271714031302e3133332e34312e383400001ad00000066b026e040015808a206d0000000a406172314338344a69526d0000002859185d94e66218548d1ecb1a12513c86126b3afb97a3c2955b1070324790733ddb059ab166de6857"
                 *  }
                 */

                req = HttpRequestItem.CreateFormRequest(ApiUrls.SendDiscussionMsg);
                json.Add("did", dMsg.Discussion.Did);
                break;

            default: throw new ArgumentOutOfRangeException(nameof(_msg));
            }
            req.Referrer = "https://d1.web2.qq.com/cfproxy.html?v=20151105001&callback=1";
            req.AddQueryValue("r", json.ToJson());
            return(req);
        }
        protected override HttpRequestItem BuildRequest()
        {
            var qrsig = HttpService.GetCookie("qrsig", ApiUrls.CheckQRCode).Value;
            var req   = new HttpRequestItem(HttpMethodType.Get, ApiUrls.CheckQRCode);

            req.AddQueryValue("ptqrtoken", QQEncryptor.GetPtqrtoken(qrsig));
            req.AddQueryValue("webqq_type", "10");
            req.AddQueryValue("remember_uin", "1");
            req.AddQueryValue("login2qq", "1");
            req.AddQueryValue("aid", "501004106");
            req.AddQueryValue("u1", "http://w.qq.com/proxy.html?login2qq=1&webqq_type=10");
            req.AddQueryValue("ptredirect", "0");
            req.AddQueryValue("ptlang", "2052");
            req.AddQueryValue("daid", "164");
            req.AddQueryValue("from_ui", "1");
            req.AddQueryValue("pttype", "1");
            req.AddQueryValue("dumy", "");
            req.AddQueryValue("fp", "loginerroralert");
            req.AddQueryValue("action", "0-0-10194");
            req.AddQueryValue("mibao_css", "m_webqq");
            req.AddQueryValue("t", "1");
            req.AddQueryValue("g", "1");
            req.AddQueryValue("js_type", "0");
            req.AddQueryValue("js_ver", JsVer);
            req.AddQueryValue("login_sig", "");
            req.AddQueryValue("pt_randsalt", "0");
            return(req);
        }
Example #15
0
        public override HttpRequestItem BuildRequest()
        {
            var req = new HttpRequestItem(HttpMethodType.Get, ApiUrls.CheckQRCode);

            req.AddQueryValue("webqq_type", "10");
            req.AddQueryValue("remember_uin", "1");
            req.AddQueryValue("login2qq", "1");
            req.AddQueryValue("aid", "501004106");
            req.AddQueryValue("u1", "http://w.qq.com/proxy.html?login2qq=1&webqq_type=10");
            req.AddQueryValue("ptredirect", "0");
            req.AddQueryValue("ptlang", "2052");
            req.AddQueryValue("daid", "164");
            req.AddQueryValue("from_ui", "1");
            req.AddQueryValue("pttype", "1");
            req.AddQueryValue("dumy", "");
            req.AddQueryValue("fp", "loginerroralert");
            req.AddQueryValue("action", "0-0-205298");
            req.AddQueryValue("mibao_css", "m_webqq");
            req.AddQueryValue("t", "1");
            req.AddQueryValue("g", "1");
            req.AddQueryValue("js_type", "0");
            req.AddQueryValue("js_ver", JsVer);
            req.AddQueryValue("login_sig", "");
            req.AddQueryValue("pt_randsalt", "0");
            return(req);
        }