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

Method playerContent

plugin/py_genmov.py:165–190  ·  view source on GitHub ↗
(self,flag,id,vipFlags)

Source from the content-addressed store, hash-verified

163 result = {}
164 return result
165 def playerContent(self,flag,id,vipFlags):
166 # https://www.genmov.com/play/301475-1-1.html
167 # https://www.genmov.com/static/js/playerconfig.js
168 url = 'https://www.genmov.com/play/{0}.html'.format(id)
169 rsp = self.fetch(url,headers=self.header)
170 root = self.html(rsp.text)
171 scripts = root.xpath("//script/text()")
172 jo = {}
173 for script in scripts:
174 if(script.startswith("var player_")):
175 target = script[script.index('{'):]
176 jo = json.loads(target)
177 break;
178 result = {}
179 parseUrl = ""
180 playerConfig = self.config['player']
181 if jo['from'] in self.config['player']:
182 parser = self.config['player'][jo['from']]
183 originUrl = jo['url']
184 parseUrl = parser['parse']
185
186 result["parse"] = parser['ps']
187 result["playUrl"] = parseUrl
188 result["url"] = originUrl
189 result["header"] = ''
190 return result
191
192 cookie = {}
193 config = {

Callers

nothing calls this directly

Calls 2

fetchMethod · 0.95
htmlMethod · 0.95

Tested by

no test coverage detected