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

Method categoryContent

plugin/py_zxzj.py:57–92  ·  view source on GitHub ↗
(self,tid,pg,filter,extend)

Source from the content-addressed store, hash-verified

55 }
56 return result
57 def categoryContent(self,tid,pg,filter,extend):
58 result = {}
59 if 'id' not in extend.keys():
60 extend['id'] = tid
61 extend['page'] = pg
62 filterParams = ["id", "area", "by", "class", "lang", "", "", "", "page", "", "", "year"]
63 params = ["", "", "", "", "", "", "", "", "", "", "", ""]
64 for idx in range(len(filterParams)):
65 fp = filterParams[idx]
66 if fp in extend.keys():
67 params[idx] = extend[fp]
68 suffix = '-'.join(params)
69 url = 'https://zxzj.vip/vodshow/{0}.html'.format(suffix)
70 rsp = self.fetch(url)
71 root = self.html(rsp.text)
72 aList = root.xpath("//div[@class='stui-vodlist__box']/a")
73 videos = []
74 for a in aList:
75 name = a.xpath('./@title')[0]
76 pic = a.xpath('./@data-original')[0]
77 mark = a.xpath("./span[@class='pic-text text-right']/text()")[0]
78 sid = a.xpath("./@href")[0]
79 sid = self.regStr(sid,"/detail/(\\S+).html")
80 videos.append({
81 "vod_id":sid,
82 "vod_name":name,
83 "vod_pic":pic,
84 "vod_remarks":mark
85 })
86
87 result['list'] = videos
88 result['page'] = pg
89 result['pagecount'] = 9999
90 result['limit'] = 90
91 result['total'] = 999999
92 return result
93 def detailContent(self,array):
94 tid = array[0]
95 url = 'https://zxzj.vip/detail/{0}.html'.format(tid)

Callers

nothing calls this directly

Calls 3

fetchMethod · 0.95
htmlMethod · 0.95
regStrMethod · 0.95

Tested by

no test coverage detected