def payParams(): domain = 'http://101.132.69.89:8071/app_dev.php/api/fish/simplified/union/pay' now = int(time.time()) params = { 'orderno': "pw" + str(now), "user_name": "pw123", "point": "1000", "payway": "1", "money": 100, "moneytype": "CNY", "time": now, "server_id": "1", "site": "7K7K" } sort_keys = sorted(params.keys()) string = "" for i in range(len(sort_keys)): string += str(params[sort_keys[i]]) key = 'yFTq1x^SdVjxBr&@^68mZ^0dcA8YwjpR' key = '987654321' string += key print(string) sign = utils.get_md5(string) params['sign'] = sign return domain, params
def sqPhoneApiParams(): domain = 'http://101.132.69.89:8071/app_dev.php/api/fish/simplified/sq/phoneApi' now = int(time.time()) params = {"sid": "1", "username": "******", "time": now} string = "" for v in params: string += str(params.get(v)) key = 'yFTq1x^SdVjxBr&@^68mZ^0dcA8YwjpR' key = 'd98Wzaf49QIu1sWgDT5CcmP1R7A7HfBM' string += key print(string) sign = utils.get_md5(string) params['sign'] = sign return domain, params
def sqParams(): domain = 'http://101.132.69.89:8071/app_dev.php/api/fish/simplified/sq/login' now = int(time.time()) params = { "user_name": "canvas0607", "server_id": "1", "is_adult": "1", "pt_vip": "1", "time": now } string = "" for v in params: string += str(params.get(v)) key = 'd98Wzaf49QIu1sWgDT5CcmP1R7A7HfBM' string += key print(string) sign = utils.get_md5(string) params['sign'] = sign return domain, params
def checkUserParams(): domain = 'http://101.132.69.89:8071/app_dev.php/api/fish/simplified/union/checkUser' now = int(time.time()) params = { 'site': "7K7K", "user_name": "pw123", "time": now, "server_id": "1" } sort_keys = sorted(params.keys()) string = "" for i in range(len(sort_keys)): string += str(params[sort_keys[i]]) key = 'yFTq1x^SdVjxBr&@^68mZ^0dcA8YwjpR' key = 'YEfOfT1wxU83wqC6fcNU30LTHydRS3EV' string += key print(string) sign = utils.get_md5(string) params['sign'] = sign return domain, params
def paySqParams(): domain = 'http://101.132.69.89:8071/app_dev.php/api/fish/simplified/sq/pay' now = int(time.time()) params = { 'order_id': ("DYa" + str(now)), "user_name": "canvas0607", "server_id": "1", "coin": "1000", "money": 100, "time": now, } string = "" for v in params: string += str(params.get(v)) key = 'tjyhEz7enK5mMzDhTtidyljSlNp5Bvq1' string += key print(string) sign = utils.get_md5(string) params['sign'] = sign return domain, params
def yielditems(self, response, item_loader, is_se=1): if is_se == 0: response = Selector(text=response) seed_lists = response.css('#seedlist tr') for seed_list in seed_lists: tmp_urls = {"baidu": "null", "bt": "null", "xunlei": "null", "xiaomi": "null", "ed2": "null"} title = seed_list.css("td a").extract_first() dr = re.compile(r'<[^>]+>', re.S) dd = dr.sub('', title) dd = dd.replace('\t', "").replace('\n', "") # 数据库主键 object_id = utils.get_md5(dd) # x = dd title_list = dd.split(" ") # 获取中文标题 chinese_title = title_list[0] eposode_info = "" eposode_position = "S00E00" for info in title_list: if re.match("S\d+E\d+", info): eposode_info = info eposode_position = title_list.index(eposode_info) # 获取集的信息 english_split = title_list[1:eposode_position] # 由于英文有空格 切片链接 english_title = " ".join(english_split) eposode_list = re.search(r"S(\d+)E(\d+)", eposode_info) season = eposode_list.group(1) episode = eposode_list.group(2) seed_list_urls = seed_list.css('td ::attr(href)').extract() for seed_list_url in seed_list_urls: if re.match("^https://pan.baidu.com*", seed_list_url, flags=0): tmp_urls['baidu'] = seed_list_url if re.match("^https://rarbg.is/download.php*", seed_list_url, flags=0): tmp_urls['bt'] = seed_list_url if re.match("^magnet:\?xt=urn:btih*", seed_list_url, flags=0): tmp_urls['xunlei'] = seed_list_url if re.match("^https:d.miwifi.com*", seed_list_url, flags=0): tmp_urls['xiaomi'] = seed_list_url if re.match("^ed2k://*", seed_list_url, flags=0): tmp_urls['ed2'] = seed_list_url decribes = seed_list.css('td::text').extract() subtitles = seed_list.css('td font::text').extract() subtitle = '无字幕' for subtitle in subtitles: if "内嵌双语字幕" in subtitle: subtitle = "内嵌双语字幕" additional_descs = {'subtitle': subtitle, "size": "null", "kind": "null", "release_time": "null"} for decribe in decribes: # 匹配大小 if re.match("(^\d+M$)|(^\d+(\.\d+)G$)", decribe, flags=0): additional_descs['size'] = decribe # 匹配类型 if re.match("普清|熟肉|(^\d+p$)", decribe, flags=0): additional_descs['kind'] = decribe if re.match("\d{4}-\d{2}-\d+", decribe, flags=0): additional_descs['release_time'] = decribe # return [additional_descs,tmp_urls,dd,tmp_urls.get('baidu'),tmp_urls.get('xunlei'),tmp_urls.get('xiaomi'),tmp_urls.get('ed2'),tmp_urls.get('bt'),additional_descs.get('kind'),additional_descs.get('size'),additional_descs.get('release_time'),additional_descs.get('subtitle'),chinese_title,english_title,season,episode,object_id] item_loader.add_value("describes", additional_descs) item_loader.add_value("urls", tmp_urls) item_loader.add_value("title", dd) item_loader.add_value("baiduUrl", tmp_urls.get('baidu')) item_loader.add_value("xunleiUrl", tmp_urls.get('xunlei')) item_loader.add_value("xiaomiUrl", tmp_urls.get('xiaomi')) item_loader.add_value("ed2Url", tmp_urls.get('ed2')) item_loader.add_value("btUrl", tmp_urls.get('bt')) item_loader.add_value("kind", additional_descs.get('kind')) item_loader.add_value("size", additional_descs.get('size')) item_loader.add_value("release_time", additional_descs.get('release_time')) item_loader.add_value("subtitle", additional_descs.get('subtitle')) item_loader.add_value("chinese_title", chinese_title) item_loader.add_value("english_title", english_title) item_loader.add_value("season", season) item_loader.add_value("episode", episode) item_loader.add_value("object_id", object_id) return item_loader