diff --git a/js/ok/laoma-simple.json b/js/ok/laoma-simple.json index 44c0ecf..0f41764 100644 --- a/js/ok/laoma-simple.json +++ b/js/ok/laoma-simple.json @@ -58,35 +58,11 @@ "timeout": 10 }, { - "key": "文采影视", - "name": "🌼文采┃1080P", - "type": 3, - "api": "csp_XBPQ", - "changeable": 0, - "jar": "./lib/b.jar", - "ext": { - "主页url": "https://www.hkybqufgh.com/", - "简介": "&&", - "嗅探词": "m3u8", - "影片类型": "tags\">&&director\">", - "影片状态": "bottom\">&&", - "二次截取": "videoList\":\\[&&\\]", - "数组": "{&&}[不包含:伦理剧]", - "标题": "vodName\":\"&&\"", - "副标题": "vodRemarks\":\"&&\"", - "链接": "https://www.hkybqufgh.com/detail/+vodId\":&&,", - "导演": "导演:&&主演", - "主演": "主演:&&别名", - "线路标题": "小米文采", - "播放数组": "listitem\">&&info\">", - "播放列表": "", - "倒序": "否", - "搜索url": "https://www.hkybqufgh.com/vod/search/{wd}", - "搜索副标题": "class=\"boottom\"*
&& 1 else vod['vod_name']}${ids[0]}@@{i['nid']}" for i in + vod['episodelist']) + vod.pop('episodelist', None) + return {'list': [vod]} + + def searchContent(self, key, quick, pg="1"): + params = { + "keyword": key, + "pageNum": pg, + "pageSize": "8", + "sourceCode": "1" + } + data = self.fetch(f"{self.host}/api/mw-movie/anonymous/video/searchByWord?{self.js(params)}", + headers=self.getheaders(params)).json() + vods = self.getvod(data['data']['result']['list']) + return {'list': vods, 'page': pg} + + def playerContent(self, flag, id, vipFlags): + self.header = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.61 Chrome/126.0.6478.61 Not/A)Brand/8 Safari/537.36', + 'sec-ch-ua-platform': '"Windows"', + 'DNT': '1', + 'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"', + 'sec-ch-ua-mobile': '?0', + 'Origin': self.host, + 'Referer': f'{self.host}/' + } + ids = id.split('@@') + pdata = self.fetch( + f"{self.host}/api/mw-movie/anonymous/v2/video/episode/url?clientType=1&id={ids[0]}&nid={ids[1]}", + headers=self.getheaders({'clientType': '1', 'id': ids[0], 'nid': ids[1]})).json() + vlist = [] + for i in pdata['data']['list']: vlist.extend([i['resolutionName'], i['url']]) + return {'parse': 0, 'url': vlist, 'header': self.header} + + def localProxy(self, param): + pass + + def md5(self, sign_key): + md5_hash = MD5.new() + md5_hash.update(sign_key.encode('utf-8')) + md5_result = md5_hash.hexdigest() + return md5_result + + def js(self, param): + return '&'.join(f"{k}={v}" for k, v in param.items()) + + def getheaders(self, param=None): + if param is None: param = {} + t = str(int(time.time() * 1000)) + param['key'] = 'cb808529bae6b6be45ecfab29a4889bc' + param['t'] = t + sha1_hash = SHA1.new() + sha1_hash.update(self.md5(self.js(param)).encode('utf-8')) + sign = sha1_hash.hexdigest() + deviceid = str(uuid.uuid4()) + headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.61 Chrome/126.0.6478.61 Not/A)Brand/8 Safari/537.36', + 'Accept': 'application/json, text/plain, */*', + 'sign': sign, + 't': t, + 'deviceid': deviceid + } + return headers + + def convert_field_name(self, field): + field = field.lower() + if field.startswith('vod') and len(field) > 3: + field = field.replace('vod', 'vod_') + if field.startswith('type') and len(field) > 4: + field = field.replace('type', 'type_') + return field + + def getvod(self, array): + return [{self.convert_field_name(k): v for k, v in item.items()} for item in array] \ No newline at end of file