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

Method searchContent

plugin/py_pansou.py:48–80  ·  view source on GitHub ↗
(self,key,quick)

Source from the content-addressed store, hash-verified

46
47
48 def searchContent(self,key,quick):
49 map = {
50 '7':'文件夹',
51 '1':'视频'
52 }
53 ja = []
54 for tKey in map.keys():
55 url = "https://www.alipansou.com/search?k={0}&t={1}".format(key,tKey)
56 rsp = self.fetch(url)
57 root = self.html(self.cleanText(rsp.text))
58 aList = root.xpath("//van-row/a")
59 for a in aList:
60 title = ''
61 # title = a.xpath('string(.//template/div)')
62 # title = self.cleanText(title).strip()
63
64 divList = a.xpath('.//template/div')
65 for div in divList:
66 t = div.xpath('string(.)')
67 t = self.cleanText(t).strip()
68 title = title + t
69 if key in title:
70 pic = 'https://www.alipansou.com'+ self.xpText(a,'.//van-card/@thumb')
71 jo = {
72 'vod_id': a.xpath('@href')[0],
73 'vod_name': '[{0}]{1}'.format(key,title),
74 'vod_pic': pic
75 }
76 ja.append(jo)
77 result = {
78 'list':ja
79 }
80 return result
81
82 def playerContent(self,flag,id,vipFlags):
83 return self.ali.playerContent(flag,id,vipFlags)

Callers

nothing calls this directly

Calls 4

fetchMethod · 0.95
htmlMethod · 0.95
cleanTextMethod · 0.95
xpTextMethod · 0.95

Tested by

no test coverage detected