| 184 | return msg[0:-paddingLen] |
| 185 | |
| 186 | def playerContent(self, flag, id, vipFlags): |
| 187 | result = {} |
| 188 | header = { |
| 189 | "User-Agent": "Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36"} |
| 190 | if id == '00000': |
| 191 | return {} |
| 192 | url = 'https://www.30dian.cn/vodplay/{0}.html'.format(id) |
| 193 | rsp = self.fetch(url,headers=header) |
| 194 | root = self.html(self.cleanText(rsp.text)) |
| 195 | scripts = root.xpath("//div[@class='embed-responsive clearfix']/script[@type='text/javascript']/text()")[0] |
| 196 | ukey = re.findall(r"url(.*)url_next", scripts)[0].replace('"', "").replace(',', "").replace(':', "") |
| 197 | pf = re.findall(r'\"from\":\"(.*?)\"', scripts)[0] |
| 198 | purl = urllib.parse.unquote(ukey) |
| 199 | if purl.startswith('http'): |
| 200 | purl = purl |
| 201 | if pf == 'wjm3u8': |
| 202 | prsp = self.fetch(purl, headers=header) |
| 203 | purle = prsp.text.strip('\n').split('\n')[-1] |
| 204 | purls = re.findall(r"http.*://.*?/", purl)[0].strip('/') |
| 205 | purl = purls + purle |
| 206 | else: |
| 207 | scrurl = 'https://vip.30dian.cn/?url={0}'.format(purl) |
| 208 | script = self.fetch(scrurl,headers=header) |
| 209 | html = script.text |
| 210 | pat = 'var le_token = \\"([\\d\\w]+)\\"' |
| 211 | cpat = 'getVideoInfo\\(\\"(.*)\\"\\)' |
| 212 | content = self.regStr(html, cpat) |
| 213 | iv = self.regStr(html, pat) |
| 214 | key = 'A42EAC0C2B408472' |
| 215 | purl = self.parseCBC(base64.b64decode(content), key, iv).decode() |
| 216 | result["parse"] = 0 |
| 217 | result["playUrl"] = '' |
| 218 | result["url"] = purl |
| 219 | result["header"] = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"} |
| 220 | return result |
| 221 | |
| 222 | config = { |
| 223 | "player": {}, |