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

Method detailContent

plugin/py_czspp.py:86–162  ·  view source on GitHub ↗
(self, array)

Source from the content-addressed store, hash-verified

84 return result
85
86 def detailContent(self, array):
87 tid = array[0]
88 url = 'https://czspp.com/movie/{0}.html'.format(tid)
89 rsp = self.fetch(url)
90 root = self.html(self.cleanText(rsp.text))
91 node = root.xpath("//div[@class='dyxingq']")[0]
92 pic = node.xpath(".//div[@class='dyimg fl']/img/@src")[0]
93 title = node.xpath('.//h1/text()')[0]
94 detail = root.xpath(".//div[@class='yp_context']//p/text()")[0]
95 vod = {
96 "vod_id": tid,
97 "vod_name": title,
98 "vod_pic": pic,
99 "type_name": "",
100 "vod_year": "",
101 "vod_area": "",
102 "vod_remarks": "",
103 "vod_actor": "",
104 "vod_director": "",
105 "vod_content": detail
106 }
107 infoArray = node.xpath(".//ul[@class='moviedteail_list']/li")
108 for info in infoArray:
109 content = info.xpath('string(.)')
110 if content.startswith('类型'):
111 tpyen = ''
112 for inf in info:
113 tn = inf.text
114 tpyen = tpyen +'/'+'{0}'.format(tn)
115 vod['type_name'] = tpyen.strip('/')
116 if content.startswith('地区'):
117 tpyeare = ''
118 for inf in info:
119 tn = inf.text
120 tpyeare = tpyeare +'/'+'{0}'.format(tn)
121 vod['vod_area'] = tpyeare.strip('/')
122 if content.startswith('豆瓣'):
123 vod['vod_remarks'] = content
124 if content.startswith('主演'):
125 tpyeact = ''
126 for inf in info:
127 tn = inf.text
128 tpyeact = tpyeact +'/'+'{0}'.format(tn)
129 vod['vod_actor'] = tpyeact.strip('/')
130 if content.startswith('导演'):
131 tpyedire = ''
132 for inf in info:
133 tn = inf.text
134 tpyedire = tpyedire +'/'+'{0}'.format(tn)
135 vod['vod_director'] = tpyedire .strip('/')
136 vod_play_from = '$$$'
137 playFrom = ['厂长']
138 vod_play_from = vod_play_from.join(playFrom)
139 vod_play_url = '$$$'
140 playList = []
141 vodList = root.xpath("//div[@class='paly_list_btn']")
142 for vl in vodList:
143 vodItems = []

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