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

Class Spider

plugin/py_zxzj.py:8–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import json
7
8class Spider(Spider): # 元类 默认的元类 type
9 def getName(self):
10 return "在线之家"
11 def init(self,extend=""):
12 print("============{0}============".format(extend))
13 pass
14 def homeContent(self,filter):
15 result = {}
16 cateManual = {
17 "电影":"1",
18 "美剧":"2",
19 "韩剧":"3",
20 "日剧":"4",
21 "泰剧":"5",
22 "动漫":"6"
23 }
24 classes = []
25 for k in cateManual:
26 classes.append({
27 'type_name':k,
28 'type_id':cateManual[k]
29 })
30
31 result['class'] = classes
32 if(filter):
33 result['filters'] = self.config['filter']
34 return result
35 def homeVideoContent(self):
36 rsp = self.fetch("https://zxzj.vip/")
37 root = self.html(rsp.text)
38 aList = root.xpath("//div[@class='stui-vodlist__box']/a")
39
40 videos = []
41 for a in aList:
42 name = a.xpath('./@title')[0]
43 pic = a.xpath('./@data-original')[0]
44 mark = a.xpath("./span[@class='pic-text text-right']/text()")[0]
45 sid = a.xpath("./@href")[0]
46 sid = self.regStr(sid,"/detail/(\\S+).html")
47 videos.append({
48 "vod_id":sid,
49 "vod_name":name,
50 "vod_pic":pic,
51 "vod_remarks":mark
52 })
53 result = {
54 'list':videos
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]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected