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

Method searchContent

plugin/py_xmaomi.py:176–204  ·  view source on GitHub ↗
(self,key,quick)

Source from the content-addressed store, hash-verified

174 }
175 return result
176 def searchContent(self,key,quick):
177 url = 'https://xmaomi.net/v_search/{0}-------------.html'.format(key)
178 tmpRsp = self.fetch(url)
179 suffix = self.regStr(tmpRsp.text,"window.location.href =\"(\\S+)\"")
180 url = "https://xmaomi.net"+suffix
181 rsp = self.fetch(url,cookies=tmpRsp.cookies)
182 root = self.html(rsp.text)
183 print(rsp.text[0])
184 print(root)
185 aList = root.xpath("//ul[contains(@class,'hl-one-list')]/li//a[contains(@class,'hl-item-thumb')]")
186 videos = []
187 for a in aList:
188 name = a.xpath('./@title')[0]
189 print(name)
190 pic = a.xpath('./@data-original')[0]
191 print(pic)
192 mark = a.xpath("./div[@class='hl-pic-text']/span/text()")[0]
193 sid = a.xpath("./@href")[0]
194 sid = self.regStr(sid,"/(\\S+).html")
195 videos.append({
196 "vod_id":sid,
197 "vod_name":name,
198 "vod_pic":pic,
199 "vod_remarks":mark
200 })
201 result = {
202 'list':videos
203 }
204 return result
205 def playerContent(self,flag,id,vipFlags):
206 url = 'https://xmaomi.net/{0}.html'.format(id)
207 tmpRsp = self.fetch(url)

Callers

nothing calls this directly

Calls 3

fetchMethod · 0.95
regStrMethod · 0.95
htmlMethod · 0.95

Tested by

no test coverage detected