async def get_detail_by_mertial_id(id): params = {'id': id, 'b_type_new': 0} url = "https://haohuo.snssdk.com/channel/material?" + urlencode(params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.snssdk.com' headers[ 'Referer'] = 'https://haohuo.snssdk.com/views/channel/material?id=%s&origin_type=3030005&origin_id=0&new_source_type=5&new_source_id=1&source_type=5&source_id=1&come_from=0' % id proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_activity_by_id(activity_id, _): params = {'id': activity_id, '_': _, 'b_type_new': 0} url = "https://bolt.jinritemai.com/api/activity/detail?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers[ 'Referer'] = 'https://bolt.jinritemai.com/h5/activity?id=%s' % activity_id proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_goods_by_id(goods_id): params = {'id': goods_id, 'b_type_new': 0} url = "https://haohuo.snssdk.com/product/fxgajaxstaticitem?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/product/item2?id=%s' % goods_id proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_kills(): params = {'b_type_new': 0} url = "https://haohuo.snssdk.com/seckill/seckillMultiSessionList?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/channel/seckill?a=1&origin_type=3030005&origin_id=0&new_source_type=5&new_source_id=1&source_type=5&source_id=1&come_from=0' proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_activity_goods(id, page): params = {'id': id, 'page': page, 'size': 10, 'b_type_new': 0} url = "https://haohuo.snssdk.com/channel/ajaxActivityGoods?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/channel/flash?a=1&origin_type=3030005&origin_id=0&new_source_type=5&new_source_id=1&source_type=5&source_id=1&come_from=0' proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_first_goods_by_shop(shop_id, page): params = { 'shop_id': shop_id, 'page': page, 'pageSize': 20, 'b_type_new': 0, } url = 'https://haohuo.snssdk.com/shop/goodsList?' + urlencode(params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/shop/index?id=%s' % shop_id proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_goods_by_material_id(activity_id, _, material_id, page): params = { 'material_id': material_id, 'page': page, 'size': 10, '_': _, 'b_type_new': 0 } url = "https://luban.snssdk.com/bolt/productlist?" + urlencode(params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://bolt.jinritemai.com' headers[ 'Referer'] = 'https://bolt.jinritemai.com/h5/activity?id=%s' % activity_id proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_goods_by_campaign_id(campaign_id, page): params = { 'campaign_id': campaign_id, 'req_id': 1, 'page': page, 'pageSize': 10, 'b_type_new': 0 } url = "https://haohuo.snssdk.com/seckill/seckillCampaignGoodsList?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/channel/seckill?a=1&origin_type=3030005&origin_id=0&new_source_type=5&new_source_id=1&source_type=5&source_id=1&come_from=0' proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_goods_by_category(cids, id, parentid, page): params = { 'second_cid': cids, 'type': 5, 'sort': 1, # ιιζεΊ 'page': page, 'pageSize': 10 } url = "https://haohuo.snssdk.com/productcategory/getList?" + urlencode( params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/views/channel/categorychoose?cids=%s&parent_id=%s&id=%s&fresh_come=undefined&origin_type=3030005&origin_id=0&new_source_type=100&new_source_id=0&source_type=100&source_id=0&come_from=0' % ( cids, parentid, id) proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)
async def get_recommend_goods(page): params = { 'cids': '', 'page': page, 'size': 10, 'addActivity': 1, 'app_id': 'undefined', 'area_type': 5, 'area_id': 0, 'origin_type': 303, 'b_type_new': 0 } url = "https://haohuo.snssdk.com/channel/ajaxGetGoods?" + urlencode(params) headers = utils.get_defind_headers() headers['User-Agent'] = utils.random_agent() headers['Origin'] = 'https://haohuo.jinritemai.com' headers[ 'Referer'] = 'https://haohuo.jinritemai.com/channel/list?origin_type=303' proxy = utils.get_proxies() return await utils.aiohttp_get(url, headers, proxy)