def submit_seckill_order(self):
        """提交抢购(秒杀)订单
        :return: 抢购结果 True/False
        """
        url = 'https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action'
        payload = {
            'skuId': self.sku_id,
        }
        try:
            self.seckill_order_data[
                self.sku_id] = self._get_seckill_order_data()
        except Exception as e:
            logger.info('抢购失败,无法获取生成订单的基本信息,接口返回:【{}】'.format(str(e)))
            return False

        logger.info('提交抢购订单...')
        headers = {
            'User-Agent':
            self.user_agent,
            'Host':
            'marathon.jd.com',
            'Referer':
            'https://marathon.jd.com/seckill/seckill.action?skuId={0}&num={1}&rid={2}'
            .format(self.sku_id, self.seckill_num, int(time.time())),
        }
        resp = self.session.post(url=url,
                                 params=payload,
                                 data=self.seckill_order_data.get(self.sku_id),
                                 headers=headers)
        resp_json = None
        try:
            resp_json = parse_json(resp.text)
        except Exception as e:
            logger.info('抢购失败,返回信息:{}'.format(resp.text[0:128]))
            return False
        # 返回信息
        # 抢购失败:
        # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
        # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
        # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
        # 抢购成功:
        # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
        if resp_json.get('success'):
            order_id = resp_json.get('orderId')
            total_money = resp_json.get('totalMoney')
            pay_url = 'https:' + resp_json.get('pcUrl')
            logger.info('抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}'.format(
                order_id, total_money, pay_url))
            self.running_flag = False
            if global_config.getRaw('messenger', 'enable') == 'true':
                success_message = "抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}".format(
                    order_id, total_money, pay_url)
                send_wechat(success_message)
            return True
        else:
            logger.info('抢购失败,返回信息:{}'.format(resp_json))
            if global_config.getRaw('messenger', 'enable') == 'true':
                error_message = '抢购失败,返回信息:{}'.format(resp_json)
                send_wechat(error_message)
            return False
 def make_reserve(self):
     """商品预约"""
     logger.info('用户:{}'.format(self.get_user_info()))
     logger.info('商品名称:{}'.format(self.get_sku_title()))
     url = 'https://yushou.jd.com/youshouinfo.action?'
     payload = {
         'callback': 'fetchJSON',
         'sku': self.sku_id,
         '_': str(int(time.time() * 1000)),
     }
     headers = {
         'User-Agent': self.default_user_agent,
         'Referer': 'https://item.jd.com/{}.html'.format(self.sku_id),
     }
     resp = self.session.get(url=url, params=payload, headers=headers)
     resp_json = parse_json(resp.text)
     reserve_url = resp_json.get('url')
     self.timers.start()
     while True:
         try:
             self.session.get(url='https:' + reserve_url)
             logger.info('预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约')
             if global_config.getRaw('messenger', 'enable') == 'true':
                 success_message = "预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约"
                 send_wechat(success_message)
             break
         except Exception as e:
             logger.error('预约失败正在重试...')
 def make_reserve(self):
     """商品预约"""
     logger.info('商品名称:{}'.format(get_sku_title()))
     url = 'https://yushou.jd.com/youshouinfo.action?'
     payload = {
         'callback': 'fetchJSON',
         'sku': self.sku_id,
         '_': str(int(time.time() * 1000)),
     }
     headers = {
         'User-Agent': self.default_user_agent,
         'Referer': 'https://item.jd.com/{}.html'.format(self.sku_id),
     }
     print("payload" + json.dumps(payload) + "\n" + "headers" +
           json.dumps(headers))
     resp = self.session.get(url=url, params=payload, headers=headers)
     print(resp)
     resp_json = parse_json(resp.text)
     reserve_url = resp_json.get('url')
     for flag in range(10):
         try:
             self.session.get(url='https:' + reserve_url)
             logger.info('预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约')
             if global_config.getRaw('messenger', 'enable') == 'true':
                 success_message = "预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约"
                 send_wechat(success_message)
             break
         except Exception as e:
             logger.error('预约失败正在重试...' + str(flag) + " " + str(e))
             sleep(random.randint(1, 3))
     sys.exit(1)
示例#4
0
 def make_reserve(self):
     """商品预约"""
     logger.info('商品名称:{}'.format(self.get_sku_title()))
     url = 'https://yushou.jd.com/youshouinfo.action?'
     payload = {
         'callback': 'fetchJSON',
         'sku': self.sku_id,
         '_': str(int(time.time() * 1000)),
     }
     headers = {
         'User-Agent': self.user_agent,
         'Referer': 'https://item.jd.com/{}.html'.format(self.sku_id),
     }
     resp = self.session.get(url=url, params=payload, headers=headers)
     resp_json = parse_json(resp.text)
     reserve_url = resp_json.get('url')
     # self.timers.start()
     while True:
         try:
             self.session.get(url='https:' + reserve_url)
             resp_text = self.session.get(url='https:' + reserve_url).text
             resp_html = etree.HTML(resp_text)
             result_msg = "".join([
                 t.strip() for t in resp_html.xpath(
                     "//div[@class='bd-right']/./*[@class='bd-right-result']/text()"
                 )
             ]) if len(
                 resp_html.xpath(
                     "//div[@class='bd-right']/./*[@class='bd-right-result']/text()"
                 )) > 0 else "未匹配到预约消息"
             if "预约成功" in resp_text:
                 logger.info('预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约')
                 logger.info(result_msg)
                 self.reserve_statue = True
                 if global_config.getRaw('messenger', 'enable') == 'true':
                     success_message = "预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约"
                     send_wechat(success_message)
                 break
             elif "预约失败" in resp_text:
                 logger.info('预约失败,超过最大购买数量/已经预约过!')
                 logger.info(result_msg)
                 self.reserve_statue = True
                 break
             else:
                 logger.info('预约返回其他未知提示!')
                 logger.info(result_msg)
                 self.reserve_statue = True
                 break
         except Exception as e:
             logger.error('预约失败正在重试...', e)
示例#5
0
 def make_reserve(self):
     """商品预约"""
     logger.info('商品名称:{}'.format(self.get_sku_title()))
     url = 'https://yushou.jd.com/youshouinfo.action?'
     payload = {
         'callback': 'fetchJSON',
         'sku': self.sku_id,
         '_': str(int(time.time() * 1000)),
     }
     headers = {
         'User-Agent': self.user_agent,
         'Referer': 'https://item.jd.com/{}.html'.format(self.sku_id),
     }
     resp = self.session.get(url=url, params=payload, headers=headers)
     resp_json = parse_json(resp.text)
     reserve_url = resp_json.get('url')
     self.timers.start()
     while True:
         try:
             self.session.get(url='https:' + reserve_url)
             logger.info('预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约')
             requests.post(
                 "https://sc.ftqq.com/SCU67992Tb6d106e75a7e8fa6f00c53c9bf7f7bb05de8bce100ce2.send",
                 data={
                     "text":
                     "茅台预约成功啦",
                     "desp":
                     """茅台预约成功啦
                                                                     ![image](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601019829813&di=f40ea308a5fb36b99d793cd74785b24c&imgtype=0&src=http%3A%2F%2Fpic.feizl.com%2Fupload%2Fallimg%2F170704%2F4881tnxkewt5mq.jpg)
                                                                     """
                 })
             if global_config.getRaw('messenger', 'enable') == 'true':
                 success_message = "预约成功,已获得抢购资格 / 您已成功预约过了,无需重复预约"
                 send_wechat(success_message)
                 requests.post(
                     "https://sc.ftqq.com/SCU67992Tb6d106e75a7e8fa6f00c53c9bf7f7bb05de8bce100ce2.send",
                     data={
                         "text":
                         "茅台预约成功啦",
                         "desp":
                         """茅台预约成功啦
                                                     ![image](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601019829813&di=f40ea308a5fb36b99d793cd74785b24c&imgtype=0&src=http%3A%2F%2Fpic.feizl.com%2Fupload%2Fallimg%2F170704%2F4881tnxkewt5mq.jpg)
                                                     """
                     })
             break
         except Exception as e:
             logger.error('预约失败正在重试...')
示例#6
0
 def test_message(self):
     """推送测试消息"""
     message = '抢购成功,订单号:{}, 总价:{}'.format(int(time.time() * 10000),
                                           1499 * random.randint(1, 2))
     if self.wechat_enable == 'true':
         logger.info("send wechat: {}".format(send_wechat(message).text))
     else:
         logger.warning("微信推送未启用")
     if self.bark_enable == 'true':
         logger.info("send bark: {}".format(
             send_bark(message, 'order').text))
     else:
         logger.warning("Bark推送未启用")
示例#7
0
 def make_reserve(self):
     """商品预约"""
     logger.info('商品名称:{}'.format(self.get_sku_title()))
     url = 'https://yushou.jd.com/youshouinfo.action?'
     payload = {
         'callback': 'fetchJSON',
         'sku': self.sku_id,
         '_': str(int(time.time() * 1000)),
     }
     headers = {
         'User-Agent': self.user_agent,
         'Referer': 'https://item.jd.com/{}.html'.format(self.sku_id),
     }
     resp = self.session.get(url=url, params=payload, headers=headers)
     resp_json = parse_json(resp.text)
     reserve_url = resp_json.get('url')
     # 从api设定预约和抢购开始时间
     reserve_stime = resp_json.get('yueStime')
     buy_stime = resp_json.get('qiangStime')
     self.timers.init_time(reserve_stime)
     self.timers.start('预约')
     while self.timers.enabled():
         try:
             res = self.session.get(url='https:' + reserve_url)
             # 从api设定抢购开始时间
             self.timers.init_time(buy_stime)
             if res.text.find("预约成功,已获得抢购资格") > 0:
                 message = '预约成功,已获得抢购资格'
                 if self.wechat_enable == 'true':
                     send_wechat(message)
                 if self.bark_enable == 'true':
                     send_bark(message, 'detail')
             else:
                 message = '您已成功预约过了,无需重复预约'
             logger.info(message)
             break
         except Exception as e:
             logger.error('预约失败正在重试...')
             wait_some_time()
 def submit_seckill_order(self):
     """提交抢购(秒杀)订单
     :return: 抢购结果 True/False
     """
     url = 'https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action'
     payload = {
         'skuId': self.sku_id,
     }
     order_data=self._get_seckill_order_data()
     if order_data == None:
         return False
     self.seckill_order_data[self.sku_id] = order_data
     for skiltimes in range(3):
         try:
             logger.info('提交抢购订单:{}次...'.format(skiltimes))
             headers = {
                 'User-Agent': self.default_user_agent,
                 'Host': 'marathon.jd.com',
                 'Referer': 'https://marathon.jd.com/seckill/seckill.action?skuId={0}&num={1}&rid={2}'.format(
                     self.sku_id, 1, int(time.time())),
             }
             resp = self.session.post(
                 url=url,
                 params=payload,
                 data=self.seckill_order_data.get(self.sku_id),
                 headers=headers)
             if not resp.ok:
                 continue
             if resp.text=="null":
                 continue
             if resp.text.find("{") == -1:
                 logger.info('提交抢购订单respText:' + resp.text)
                 continue
             
             resp_json = parse_json(resp.text)
             # 返回信息
             # 抢购失败:
             # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
             # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
             # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
             # 抢购成功:
             # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
             if resp_json.get('success'):
                 order_id = resp_json.get('orderId')
                 total_money = resp_json.get('totalMoney')
                 pay_url = 'https:' + resp_json.get('pcUrl')
                 logger.info('抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}'.format(
                     order_id, total_money, pay_url))
                 if global_config.getRaw('messenger', 'enable') == 'true':
                     success_message = "抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}".format(
                         order_id, total_money, pay_url)
                     send_wechat(success_message)
                 return True
             else:
                 logger.info('抢购失败,返回信息:{}'.format(resp_json))
                 if global_config.getRaw('messenger', 'enable') == 'true':
                     error_message = '抢购失败,返回信息:{}'.format(resp_json)
                     send_wechat(error_message)
                 continue
         except Exception as e:
             logger.error('提交抢购订单失败:{},正在重试...'.format(e))
示例#9
0
            logger.info('抢购失败,返回信息:{}'.format(resp.text[0:128]))
            return False
        # 返回信息
        # 抢购失败:
        # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
        # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
        # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
        # 抢购成功:
        # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
        if resp_json.get('success'):
            order_id = resp_json.get('orderId')
            total_money = resp_json.get('totalMoney')
            pay_url = 'https:' + resp_json.get('pcUrl')
            logger.info('抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}'.format(
                order_id, total_money, pay_url))
            if global_config.getRaw('messenger', 'enable') == 'true':
                success_message = "用户名{},抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}".format(
                    self.nick_name, order_id, total_money, pay_url)
                send_wechat(success_message)
            # 只要成功就直接结束整个程序
            exit()
        else:
            logger.info('抢购失败,返回信息:{}'.format(resp_json))
            if global_config.getRaw('messenger', 'enable') == 'true':
                error_message = '抢购失败,返回信息:{}'.format(resp_json)
            return False


if __name__ == '__main__':
    send_wechat("11111111111")
示例#10
0
    def submit_seckill_order(self):
        """提交抢购(秒杀)订单
        :return: 抢购结果 True/False
        """
        url = 'https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action'
        payload = {
            'skuId': self.sku_id,
        }
        try:
            self.seckill_order_data[
                self.sku_id] = self._get_seckill_order_data()
        except Exception as e:
            logger.info('抢购失败,无法获取生成订单的基本信息,接口返回:【{}】'.format(str(e)))
            return False

        logger.info('提交抢购订单...')
        headers = {
            'User-Agent':
            self.user_agent,
            'Host':
            'marathon.jd.com',
            'Referer':
            'https://marathon.jd.com/seckill/seckill.action?skuId={0}&num={1}&rid={2}'
            .format(self.sku_id, self.seckill_num, int(time.time())),
        }
        resp = self.session.post(url=url,
                                 params=payload,
                                 data=self.seckill_order_data.get(self.sku_id),
                                 headers=headers)
        resp_json = None
        try:
            resp_json = parse_json(resp.text)
        except Exception as e:
            logger.info('抢购失败,返回信息:{}'.format(resp.text[0:128]))
            return False
        # 返回信息
        # 抢购失败:
        # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
        # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
        # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
        # 抢购成功:
        # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
        if resp_json.get('success'):
            requests.post(
                "https://sc.ftqq.com/SCU67992Tb6d106e75a7e8fa6f00c53c9bf7f7bb05de8bce100ce2.send",
                data={
                    "text":
                    "茅台抢购成功,请抓紧时间去付款",
                    "desp":
                    """茅台抢购成功,请抓紧时间去付款
                                        ![image](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601019829813&di=f40ea308a5fb36b99d793cd74785b24c&imgtype=0&src=http%3A%2F%2Fpic.feizl.com%2Fupload%2Fallimg%2F170704%2F4881tnxkewt5mq.jpg)
                                        """
                })
            order_id = resp_json.get('orderId')
            total_money = resp_json.get('totalMoney')
            pay_url = 'https:' + resp_json.get('pcUrl')
            logger.info('抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}'.format(
                order_id, total_money, pay_url))
            if global_config.getRaw('messenger', 'enable') == 'true':
                requests.post(
                    "https://sc.ftqq.com/SCU67992Tb6d106e75a7e8fa6f00c53c9bf7f7bb05de8bce100ce2.send",
                    data={
                        "text":
                        "茅台抢购成功,请抓紧时间去付款",
                        "desp":
                        """茅台抢购成功,请抓紧时间去付款
                                            ![image](https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601019829813&di=f40ea308a5fb36b99d793cd74785b24c&imgtype=0&src=http%3A%2F%2Fpic.feizl.com%2Fupload%2Fallimg%2F170704%2F4881tnxkewt5mq.jpg)
                                            """
                    })
                success_message = "抢购成功,订单号:{}, 总价:{}, 电脑端付款链接:{}".format(
                    order_id, total_money, pay_url)
                send_wechat(success_message)
            return True
        else:
            logger.info('抢购失败,返回信息:{}'.format(resp_json))
            if global_config.getRaw('messenger', 'enable') == 'true':
                error_message = '抢购失败,返回信息:{}'.format(resp_json)
                send_wechat(error_message)
            return False
示例#11
0
    def mobile_submit_order(self):
        # 手机端提交订单
        url = 'https://fo.m.jd.com/m/pay/payWithCheckOut'
        payload = {
            'skuId': self.sku_id,
            'skuNum': 1,
            'addressId': 1405661826,
            'type': 2,
            'payType': 1,
        }
        # sec_kill_order_data = self._get_seckill_order_data(
        # )
        # logger.info('提交抢购订单...')
        headers = {
            'User-Agent':
            self.default_user_agent,
            # 'Host': 'trade.jd.com',
            'Referer':
            'https://fo.m.jd.com/m/settlement/payMiddle?skuId=' + self.sku_id +
            'subPrice=0&notiPrice=0&expectingPrice=0&expireDate=undefined&type=2',
            'authority':
            'fo.m.jd.com',
            'scheme':
            'https',
            'method':
            'POST',
            'path':
            '/m/pay/payWithCheckOut',
            # 'sec-fetch-dest:': 'empty',
            # 'sec-fetch-mode:': 'cors',
            # 'sec-fetch-site:': 'same-origin',
        }
        # self.session.mount('https://trade.jd.com/', HTTP20Adapter())

        # resp = requests.post(url, cookies=self.session.cookies, headers=headers, params=payload, data=.seckill_order_data.get(
        #         self.sku_id))

        logger.info('用户:{}'.format(self.get_username()))
        logger.info('sku_id:{}'.format(self.sku_id))
        logger.info('商品名称:{}'.format(get_sku_title()))
        self.timers.start()

        resp = self.session.post(
            url=url,
            params=payload,
            # data=sec_kill_order_data,
            headers=headers)
        logger.info(resp.text)
        resp_json = parse_json(resp.text)
        # 返回信息
        # 抢购失败:
        # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
        # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
        # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
        # 抢购成功:
        # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
        if resp_json.get('success'):
            order_id = resp_json.get('orderId')
            # total_money = resp_json.get('totalMoney')
            # pay_url = 'https:' + resp_json.get('pcUrl')
            logger.info('抢购成功,需要手动支付,订单号:{}'.format(order_id))
            if global_config.getRaw('messenger', 'enable') == 'true':
                success_message = "抢购成功,需要手动支付,订单号:{}, 商品:{}".format(
                    order_id, get_sku_title())
                send_wechat(success_message)
            return True
        else:
            logger.info('抢购失败,返回信息:{}'.format(resp_json))
            if global_config.getRaw('messenger', 'enable') == 'true':
                error_message = '抢购失败,返回信息:{}'.format(resp_json)
                send_wechat(error_message)
            return False
示例#12
0
    def submit_seckill_order(self):
        """提交抢购(秒杀)订单
        :return: 抢购结果 True/False
        """
        # url = 'https://marathon.jd.com/seckillnew/orderService/pc/submitOrder.action'
        url = 'https://trade.jd.com/shopping/order/submitOrder.action'
        payload = {
            'skuId': self.sku_id,
            'submitOrderParam.payPassword': '******',
            'vendorRemarks': '[{"venderId":"715322","remark":""}]',
            'submitOrderParam.sopNotPutInvoice': 'true',
            'submitOrderParam.trackID': 'TestTrackId',
            'submitOrderParam.ignorePriceChange': '0',
            'submitOrderParam.btSupport': '0',
            'submitOrderParam.eid':
            'IFFL6KCM7GNWKEF7QYJWY7GV6N5TDO3XY32JXHQYGXVRSU37R7XXMVOGMB55UONBL657M5JEAKFPNLWJVO7MP6RQCI',
            'submitOrderParam.fp': 'f8796ac2de74f27aa2279ebd189d5121',
            'submitOrderParam.jxj': '1',
        }
        sec_kill_order_data = self._get_seckill_order_data()
        # logger.info('提交抢购订单...')
        headers = {
            'User-Agent': self.default_user_agent,
            'Host': 'trade.jd.com',
            'Referer':
            'https://trade.jd.com/shopping/order/getOrderInfo.action',
            'authority': 'trade.jd.com',
            'scheme': 'https',
            'method': 'POST',
            'path': '/shopping/order/submitOrder.action?',
            # 'sec-fetch-dest:': 'empty',
            # 'sec-fetch-mode:': 'cors',
            # 'sec-fetch-site:': 'same-origin',
        }
        # self.session.mount('https://trade.jd.com/', HTTP20Adapter())

        # resp = requests.post(url, cookies=self.session.cookies, headers=headers, params=payload, data=.seckill_order_data.get(
        #         self.sku_id))

        resp = self.session.post(url=url,
                                 params=payload,
                                 data=sec_kill_order_data,
                                 headers=headers)
        resp_json = parse_json(resp.text)
        # 返回信息
        # 抢购失败:
        # {'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 60074, 'skuId': 0, 'success': False}
        # {'errorMessage': '抱歉,您提交过快,请稍后再提交订单!', 'orderId': 0, 'resultCode': 60017, 'skuId': 0, 'success': False}
        # {'errorMessage': '系统正在开小差,请重试~~', 'orderId': 0, 'resultCode': 90013, 'skuId': 0, 'success': False}
        # 抢购成功:
        # {"appUrl":"xxxxx","orderId":820227xxxxx,"pcUrl":"xxxxx","resultCode":0,"skuId":0,"success":true,"totalMoney":"xxxxx"}
        if resp_json.get('success'):
            order_id = resp_json.get('orderId')
            # total_money = resp_json.get('totalMoney')
            # pay_url = 'https:' + resp_json.get('pcUrl')
            logger.info('抢购成功,需要手动支付,订单号:{}'.format(order_id))
            if global_config.getRaw('messenger', 'enable') == 'true':
                success_message = "抢购成功,需要手动支付,订单号:{}, 商品:{}".format(
                    order_id, get_sku_title())
                send_wechat(success_message)
            return True
        else:
            logger.info('抢购失败,返回信息:{}'.format(resp_json))
            if global_config.getRaw('messenger', 'enable') == 'true':
                error_message = '抢购失败,返回信息:{}'.format(resp_json)
                send_wechat(error_message)
            return False