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

Method detailContent

plugin/py_3qu.py:72–130  ·  view source on GitHub ↗
(self, array)

Source from the content-addressed store, hash-verified

70 return result
71
72 def detailContent(self, array):
73 tid = array[0]
74 url = 'https://www.3qu.live/videos/{0}.html'.format(tid)
75 header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"}
76 rsp = self.fetch(url,headers=header)
77 root = self.html(self.cleanText(rsp.text))
78 divContent = root.xpath("//div[@class='video-detail row']")[0]
79 title = divContent.xpath(".//div[@class='info-box']/a/h1/text()")[0]
80 pica = divContent.xpath(".//div[@class='thumb-box']/img/@src")[0]
81 pic = 'https://www.3qu.live{0}'.format(pica)
82 vod = {
83 "vod_id": tid,
84 "vod_name": title,
85 "vod_pic": pic,
86 "type_name": "",
87 "vod_year": "",
88 "vod_area": "",
89 "vod_remarks": "",
90 "vod_actor": "",
91 "vod_director": "",
92 "vod_content": ""
93 }
94 infoArray = divContent.xpath(".//div[@class='info-box']/ul/li")
95 for info in infoArray:
96 content = info.xpath('string(.)')
97 flag = "类型" in content
98 if flag == True:
99 infon = content.strip().split(' ')
100 for inf in infon:
101 if inf.startswith('类型'):
102 vod['type_name'] = inf.replace("类型:", "")
103 if inf.startswith('地区'):
104 vod['vod_area'] = inf.replace("地区:", "")
105 if inf.startswith('语言'):
106 vod['vod_remarks'] = inf.replace("语言:", "")
107 if content.startswith('演员'):
108 vod['vod_actor'] = content.replace("演员:", "")
109 if content.startswith('年份'):
110 yearl = content.split(' ')
111 year = yearl[0].replace("年份:", "")
112 vod['vod_year'] = year
113 if content.startswith('导演'):
114 vod['vod_director'] = content.replace("导演:", "")
115 if content.startswith('简介'):
116 vod['vod_content'] = content.replace("简介:", "")
117 vodList = root.xpath(".//div[@class='tab-content']/div[@id='playlist']/a")
118 playUrl = ''
119 for vl in vodList:
120 name = vl.xpath("./text()")[0]
121 did = vl.xpath("./@data-id")[0]
122 playUrl = playUrl + '{0}${1}_{2}#'.format(name,tid,did)
123 vod['vod_play_from'] = '快播影视'
124 vod['vod_play_url'] = playUrl
125 result = {
126 'list': [
127 vod
128 ]
129 }

Callers

nothing calls this directly

Calls 3

fetchMethod · 0.95
htmlMethod · 0.95
cleanTextMethod · 0.95

Tested by

no test coverage detected