提交 4bbc7391 编写于 作者: H hjdhnx

完成cms搜索数据封装

上级 a66ba75e
......@@ -54,24 +54,8 @@ class CMS:
return result
def homeVideoContent(self):
rsp = self.fetch("https://www.genmov.com/", headers=self.header)
root = self.html(rsp.text)
aList = root.xpath("//div[@class='module module-wrapper']//div[@class='module-item']")
videos = []
for a in aList:
name = a.xpath(".//div[@class='module-item-pic']/a/@title")[0]
pic = a.xpath(".//div[@class='module-item-pic']/img/@data-src")[0]
mark = a.xpath("./div[@class='module-item-text']/text()")[0]
sid = a.xpath(".//div[@class='module-item-pic']/a/@href")[0]
sid = self.regStr(sid, "/video/(\\S+).html")
videos.append({
"vod_id": sid,
"vod_name": name,
"vod_pic": pic,
"vod_remarks": mark
})
result = {
'list': videos
'list': []
}
return result
......
{
{"sites":[{
"key":"dr_yanaifei",
"name":"鸭奈飞",
"type":4,
"type":1,
"api":"http://192.168.10.99:9000/vod?rule=鸭奈飞",
"searchable": 1,
"quickSearch": 1,
"filterable": 1
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册