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

Class Spider

plugin/py_cokemv.py:10–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import base64
9
10class Spider(Spider): # 元类 默认的元类 type
11 def getName(self):
12 return "Cokemv"
13 def init(self,extend=""):
14 print("============{0}============".format(extend))
15 pass
16 def homeContent(self,filter):
17 result = {}
18 cateManual = {
19 "抖音电影":"5",
20 "电视剧":"2",
21 "电影":"1",
22 "动漫":"4",
23 "综艺":"3"
24 }
25 classes = []
26 for k in cateManual:
27 classes.append({
28 'type_name':k,
29 'type_id':cateManual[k]
30 })
31
32 result['class'] = classes
33 if(filter):
34 result['filters'] = self.config['filter']
35 return result
36 def homeVideoContent(self):
37 rsp = self.fetch("https://cokemv.me/")
38 root = self.html(rsp.text)
39 aList = root.xpath("//div[@class='main']//div[contains(@class,'module-items')]/a")
40
41 videos = []
42 for a in aList:
43 name = a.xpath('./@title')[0]
44 pic = a.xpath('.//img/@data-original')[0]
45 mark = a.xpath(".//div[@class='module-item-note']/text()")[0]
46 sid = a.xpath("./@href")[0]
47 sid = self.regStr(sid,"/voddetail/(\\S+).html")
48 videos.append({
49 "vod_id":sid,
50 "vod_name":name,
51 "vod_pic":pic,
52 "vod_remarks":mark
53 })
54 result = {
55 'list':videos
56 }
57 return result
58 def categoryContent(self,tid,pg,filter,extend):
59 result = {}
60
61 urlParams = ["", "", "", "", "", "", "", "", "", "", "", ""]
62 urlParams[0] = tid
63 urlParams[8] = pg
64 for key in extend:
65 urlParams[int(key)] = extend[key]
66 params = '-'.join(urlParams)
67 url = 'https://cokemv.me/vodshow/{0}.html'.format(params)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected