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

Method searchContent

plugin/py_cyys.py:154–177  ·  view source on GitHub ↗
(self, key, quick)

Source from the content-addressed store, hash-verified

152 return result
153
154 def searchContent(self, key, quick):
155 url = 'https://www.30dian.cn/vodsearch/-------------.html?wd={0}'.format(key)
156 header = {
157 "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"}
158 rsp = self.fetch(url, headers=header)
159 root = self.html(self.cleanText(rsp.text))
160 aList = root.xpath("//ul[contains(@class,'myui-vodlist__media clearfix')]/li")
161 videos = []
162 for a in aList:
163 name = a.xpath(".//div[@class='detail']/h4/a/text()")[0]
164 pic = a.xpath(".//a[contains(@class,'myui-vodlist__thumb')]//@data-original")[0]
165 mark = a.xpath(".//span[@class='tag']/text()")[0]
166 sid = a.xpath(".//div[@class='detail']/h4/a/@href")[0]
167 sid = self.regStr(sid,'/voddetail/(\\S+).html')
168 videos.append({
169 "vod_id": sid,
170 "vod_name": name,
171 "vod_pic": pic,
172 "vod_remarks": mark
173 })
174 result = {
175 'list': videos
176 }
177 return result
178 def parseCBC(self, enc, key, iv):
179 keyBytes = key.encode("utf-8")
180 ivBytes = iv.encode("utf-8")

Callers

nothing calls this directly

Calls 4

fetchMethod · 0.95
htmlMethod · 0.95
cleanTextMethod · 0.95
regStrMethod · 0.95

Tested by

no test coverage detected