MCPcopy Create free account
hub / github.com/UndCover/PyramidStore / playerContent

Method playerContent

plugin/py_cctv_full.py:180–205  ·  view source on GitHub ↗
(self,flag,id,vipFlags)

Source from the content-addressed store, hash-verified

178 }
179 return result
180 def playerContent(self,flag,id,vipFlags):
181 result = {}
182 url = "https://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={0}".format(id)
183 jo = self.fetch(url,headers=self.header).json()
184 link = jo['hls_url'].strip()
185 rsp = self.fetch(link,headers=self.header)
186 content = rsp.text.strip()
187 arr = content.split('\n')
188 urlPrefix = self.regStr(link,'(http[s]?://[a-zA-z0-9.]+)/')
189
190 subUrl = arr[-1].split('/')
191 subUrl[3] = '1200'
192 subUrl[-1] = '1200.m3u8'
193 hdUrl = urlPrefix + '/'.join(subUrl)
194
195 url = urlPrefix + arr[-1]
196
197 hdRsp = self.fetch(hdUrl,headers=self.header)
198 if hdRsp.status_code == 200:
199 url = hdUrl
200
201 result["parse"] = 0
202 result["playUrl"] = ''
203 result["url"] = url
204 result["header"] = ''
205 return result
206
207 config = {
208 "player": {},

Callers

nothing calls this directly

Calls 2

fetchMethod · 0.95
regStrMethod · 0.95

Tested by

no test coverage detected