Example #1
0
    """
    '''
    100016578654 6800xt 26 11:00
    100008550195 3080 26 11:00
    100019176614 6700xt 26 11:00
    100016046826 3070 26 11:00
    100016672406 3090 26 11:00

    
    100008979445 3070 26 15:00
    10027264803895 3060ti 27 12:00
    100016914910 3060ti 29 11:00
    '''
    sku_ids = '10026920091878'  # 商品id
    # sku_ids = ['100019176614', '100016578654', '100008550195', '100016046826', '100016672406']
    area = '1_2800_4209'  # 区域id
    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    # for i in sku_ids:
    asst.exec_reserve_seckill_by_time(sku_id=sku_ids,
                                      buy_time='2021-03-27 12:00:00.000')

    # asst.buy_item_in_stock(sku_ids=sku_ids, area=area, wait_all=False, stock_interval=3)  # 根据商品是否有货自动下单
    # 6个参数:
    # sku_ids: 商品id。可以设置多个商品,也可以带数量,如:'1234' 或 '1234,5678' 或 '1234:2' 或 '1234:2,5678:3'
    # area: 地区id
    # wait_all: 是否等所有商品都有货才一起下单,可选参数,默认False
    # stock_interval: 查询库存时间间隔,可选参数,默认3秒
    # submit_retry: 提交订单失败后重试次数,可选参数,默认3次
    # submit_interval: 提交订单失败后重试时间间隔,可选参数,默认5秒
Example #2
0
    #        :return:
    #        """

    elif x == 2:
        asst.exec_seckill_by_time(sku_ids=sku_ids, buy_time=buy_time)
    # """定时抢购
    # :param sku_ids: 商品id,多个商品id用逗号进行分割,如"123,456,789"
    # :param buy_time: 下单时间,例如:'2018-09-28 22:45:50.000'
    # :param retry: 抢购重复执行次数,可选参数,默认4次
    # :param interval: 抢购执行间隔,可选参数,默认4秒
    # :param num: 购买数量,可选参数,默认1个
    # :return:
    # """

    elif x == 3:
        asst.exec_reserve_seckill_by_time(sku_id=sku_ids, buy_time=buy_time)
    # 执行预约抢购
    # 5个参数
    # sku_id: 商品id
    # buy_time: 下单时间,例如:'2019-11-10 22:41:30.000'
    # retry: 抢购重复执行次数,可选参数,默认4次
    # interval: 抢购执行间隔,可选参数,默认4秒
    # num: 购买数量,可选参数,默认1个

    elif x == 4:
         asst.submit_order_by_time(sku_ids=sku_ids, buy_time=buy_time, retry=4, interval=5)  # 定时提交订单
    # 3个参数:
    # buy_time: 下单时间,例如:'2019-02-16 01:17:59.500'
    # retry: 下单重复执行次数,可选参数,默认4次
    # interval: 下单执行间隔,可选参数,默认5秒
Example #3
0
     # 开始预约
     if reserve_time:
         asst.make_reserve(sku_id, reserve_time + '.000')
     else:
         print('获取预约时间失败')
     # 开始抢购
     if buy_time:
         rand_msecond = random.randint(1, 9) * 1000
         buy_time = buy_time + '.000'
         # buy_time = buy_time + "." + str(rand_msecond)
     else:
         print('获取抢购时间失败')
         buy_time = input("请输入抢购时间(2020-03-04 00:59:59.000):")
     asst.exec_reserve_seckill_by_time(sku_id=sku_id,
                                       buy_time=buy_time,
                                       retry=10,
                                       interval=1,
                                       num=1)
     # asst.exec_seckill_by_time(sku_ids=sku_id, buy_time=buy_time, retry=15, interval=0.2, num=1)
 elif model_type == '2':
     print("正常有货购买...")
     sku_ids = input("请输入一个或多个sku_id:")
     area = input("请输入area_id:")
     asst.buy_item_in_stock(sku_ids=sku_ids,
                            area=area,
                            wait_all=False,
                            stock_interval=5)
 elif model_type == '3':
     print("正常定时购买...")
     sku_ids = input("请输入一个或多个sku_id:")
     buy_time = input("请输入定时购买时间(2020-03-04 00:59:59.000):")
Example #4
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant

if __name__ == '__main__':
    """
    重要提示:此处为示例代码之一,请移步下面的链接查看使用教程👇
    https://github.com/tychxn/jd-assistant/wiki/1.-%E4%BA%AC%E4%B8%9C%E6%8A%A2%E8%B4%AD%E5%8A%A9%E6%89%8B%E7%94%A8%E6%B3%95
    """

    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    asst.clear_cart()
    asst.exec_reserve_seckill_by_time(sku_id="100006047279",
                                      buy_time="2020-01-17 20:00:00.001")
    # 执行预约抢购
    # 5个参数
    # sku_id: 商品id
    # buy_time: 下单时间,例如:'2019-11-10 22:41:30.000'
    # retry: 抢购重复执行次数,可选参数,默认4次
    # interval: 抢购执行间隔,可选参数,默认4秒
    # num: 购买数量,可选参数,默认1个
Example #5
0
    is_pass_cart = True  # 是否跳过添加购物车,默认True

    # 配置【预约抢购,不会自动加入购物车】
    # area = '19_1607_3155_62117'  # 区域id
    # sku_buy_time = '2020-12-04 15:00:00.000'  # 商品抢购时间
    # buy_time = None  # 开始抢购时间,默认为None,自动提前0.050秒,网络通畅时不需要修改,如果网络慢可根据自己情况适当修改,格式:'2020-11-28 12:59:59.950'
    # fast_mode = True  # 快速模式:略过访问抢购订单结算页面这一步骤,默认为 True

    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆

    # 执行【预约抢购,自动加入购物车】 一定要确保预约的商品在购物车中才能使用这种方式!!!否则只能用其他方式
    asst.exec_reserve_seckill_by_time(sku_id=sku_id,
                                      buy_time=buy_time,
                                      retry=retry,
                                      interval=interval,
                                      num=num,
                                      is_pass_cart=is_pass_cart,
                                      sleep_interval=sleep_interval,
                                      fast_sleep_interval=fast_sleep_interval)

    # 执行【预约抢购,不会自动加入购物车】
    # asst.exec_seckill_by_time(sku_ids=sku_id, buy_time=buy_time, sku_buy_time=sku_buy_time, retry=retry, interval=interval, num=num, fast_mode=fast_mode, sleep_interval=sleep_interval, fast_sleep_interval=fast_sleep_interval)

    # 根据商品是否有货自动下单
    # 6个参数:
    # sku_ids: 商品id。可以设置多个商品,也可以带数量,如:'1234' 或 '1234,5678' 或 '1234:2' 或 '1234:2,5678:3'
    # area: 地区id
    # wait_all: 是否等所有商品都有货才一起下单,可选参数,默认False
    # stock_interval: 查询库存时间间隔,可选参数,默认3秒
    # submit_retry: 提交订单失败后重试次数,可选参数,默认3次
    # submit_interval: 提交订单失败后重试时间间隔,可选参数,默认5秒
Example #6
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant

if __name__ == '__main__':
    """
    重要提示:此处为示例代码之一,请移步下面的链接查看使用教程👇
    https://github.com/tychxn/jd-assistant/wiki/1.-%E4%BA%AC%E4%B8%9C%E6%8A%A2%E8%B4%AD%E5%8A%A9%E6%89%8B%E7%94%A8%E6%B3%95
    """

    sku_ids = '100012043978'  # 茅台商品id
    area = '19_1609_41655_41710'  # 区域id
    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    # asst.clear_cart() # 清空购物车(可选)
    # asst.add_item_to_cart(sku_ids='100016117840')  # 根据商品id添加购物车(可选)
    # asst.submit_order_by_time(buy_time='2020-11-10 20:59:59.700', retry=4, interval= 0.5) #普通订单可用
    # asst.exec_seckill_by_time(sku_ids =sku_ids,buy_time='2020-11-10 23:59:59.700', retry=5, interval= 0.5)  # 定时提交秒杀订单
    asst.exec_reserve_seckill_by_time(sku_id='100016117840',
                                      buy_time='2020-11-11 07:59:59.975',
                                      retry=4,
                                      interval=0.2)  #该秒杀会放入购物车
    # asst.buy_item_in_stock(sku_ids=sku_ids, area=area, wait_all=False, stock_interval=5)  # 根据商品是否有货自动下单
    # 6个参数:
    # sku_ids: 商品id。可以设置多个商品,也可以带数量,如:'1234' 或 '1234,5678' 或 '1234:2' 或 '1234:2,5678:3'
    # area: 地区id
    # wait_all: 是否等所有商品都有货才一起下单,可选参数,默认False
    # stock_interval: 查询库存时间间隔,可选参数,默认3秒
    # submit_retry: 提交订单失败后重试次数,可选参数,默认3次
    # submit_interval: 提交订单失败后重试时间间隔,可选参数,默认5秒
Example #7
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant

if __name__ == '__main__':
    """
    重要提示:此处为示例代码之一,请移步下面的链接查看使用教程👇
    https://github.com/tychxn/jd-assistant/wiki/1.-%E4%BA%AC%E4%B8%9C%E6%8A%A2%E8%B4%AD%E5%8A%A9%E6%89%8B%E7%94%A8%E6%B3%95
    """

    asst = Assistant()      # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    asst.exec_reserve_seckill_by_time(sku_id='100012043978', buy_time='2020-06-23 10:00:00.000', retry=3, interval=0.5)
    # asst.exec_reserve_seckill_by_time(sku_id='7897905', buy_time='2020-06-23 9:25:00.000', retry=3, interval=0.1)
    
Example #8
0
    expected_timestamp = parse(expected_time).timestamp()
    # 商品id 飞天茅台53:100012043978;
    # 小米路由AX3600:100011385902;
    # 惠寻一次性医用口罩: 66235396248;
    # 3Q一次性医用外科口罩: 100011551632;
    # 袋鼠医生(DR.ROOS)医用外科口罩: 100006394713;
    sku_ids = '100012043978'
    area = '1_2801_54769'  # 区域id
    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    asst.make_reserve(sku_ids)
    while True:
        print(time.time() > expected_timestamp)
        if time.time() > expected_timestamp:
            print("start buy maotai !!!", buy_count)
            asst.exec_reserve_seckill_by_time(sku_ids, expected_buy_time, retry=3, interval=5, num=2)
            buy_count = buy_count + 1
        time.sleep(100)

    # asst.add_item_to_cart(sku_ids=sku_ids)  # 根据商品id添加购物车(可选)
    # asst.buy_item_in_stock(sku_ids=sku_ids, area=area, wait_all=False, stock_interval=5)
    # asst.submit_order_by_time(buy_time='2020-04-02 09:59:59.750', retry=4, interval=2)  # 定时提交订单
    # asst.buy_item_in_stock(sku_ids=sku_ids, area=area, wait_all=False, stock_interval=5)  # 根据商品是否有货自动下单

    # 6个参数:
    # sku_ids: 商品id。可以设置多个商品,也可以带数量,如:'1234' 或 '1234,5678' 或 '1234:2' 或 '1234:2,5678:3'
    # area: 地区id
    # wait_all: 是否等所有商品都有货才一起下单,可选参数,默认False
    # stock_interval: 查询库存时间间隔,可选参数,默认3秒
    # submit_retry: 提交订单失败后重试次数,可选参数,默认3次
    # submit_interval: 提交订单失败后重试时间间隔,可选参数,默认5秒
Example #9
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jd_assistant import Assistant
from sku_extract import get_sku_list

if __name__ == '__main__':
    """
    重要提示:此处为示例代码之一,请移步下面的链接查看使用教程👇
    https://github.com/tychxn/jd-assistant/wiki/1.-%E4%BA%AC%E4%B8%9C%E6%8A%A2%E8%B4%AD%E5%8A%A9%E6%89%8B%E7%94%A8%E6%B3%95
    """
    sku_ids = get_sku_list('sku_ids.txt')  # 商品id
    area = '19_1684_19468_51438'
    asst = Assistant()  # 初始化
    asst.login_by_QRcode()  # 扫码登陆
    asst.buy_item_in_stock(sku_ids=sku_ids,
                           area=area,
                           wait_all=False,
                           stock_interval=0)
    asst.clear_cart()
    asst.exec_reserve_seckill_by_time(sku_id="100009083498",
                                      buy_time="2019-11-10 22:42:30.000")
    # 执行预约抢购
    # 5个参数
    # sku_id: 商品id
    # buy_time: 下单时间,例如:'2019-11-10 22:41:30.000'
    # retry: 抢购重复执行次数,可选参数,默认4次
    # interval: 抢购执行间隔,可选参数,默认4秒
    # num: 购买数量,可选参数,默认1个