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

Class Spider

plugin/py_3qu.py:10–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import json
9
10class Spider(Spider): # 元类 默认的元类 type
11 def getName(self):
12 return "快播影视"
13
14 def init(self, extend=""):
15 print("============{0}============".format(extend))
16 pass
17
18 def homeContent(self, filter):
19 result = {}
20 cateManual = {
21 "电影": "movie",
22 "剧集": "serie",
23 "综艺": "variety",
24 "动漫": "anime"
25 }
26 classes = []
27 for k in cateManual:
28 classes.append({
29 'type_name': k,
30 'type_id': cateManual[k]
31 })
32
33 result['class'] = classes
34 if (filter):
35 result['filters'] = self.config['filter']
36 return result
37
38 def homeVideoContent(self):
39 result = {
40 'list': []
41 }
42 return result
43
44 def categoryContent(self, tid, pg, filter, extend):
45 result = {}
46 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"}
47 url = 'https://www.3qu.live/videos/{0}?page={1}'.format(tid, pg)
48 rsp = self.fetch(url,headers=header)
49 root = self.html(self.cleanText(rsp.text))
50 aList = root.xpath("//div[@class='main-content-box']/div/div/div/div/div/div/a")
51 videos = []
52 for a in aList:
53 name = a.xpath('./@title')[0]
54 picl = a.xpath('./@style')[0]
55 pica = re.findall(r"url\(\'(.*)\'\);", picl)[0]
56 pic = 'https://www.3qu.live{0}'.format(pica)
57 sidh = a.xpath("./@href")[0]
58 sid = self.regStr(sidh,'/videos/(\\S+).html')
59 videos.append({
60 "vod_id": sid,
61 "vod_name": name,
62 "vod_pic": pic,
63 "vod_remarks": ""
64 })
65 result['list'] = videos
66 result['page'] = pg
67 result['pagecount'] = 9999

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected