| 7 | from Crypto.Cipher import AES |
| 8 | |
| 9 | class Spider(Spider): # 元类 默认的元类 type |
| 10 | def getName(self): |
| 11 | return "厂长资源" |
| 12 | |
| 13 | def init(self, extend=""): |
| 14 | print("============{0}============".format(extend)) |
| 15 | pass |
| 16 | |
| 17 | def homeContent(self, filter): |
| 18 | result = {} |
| 19 | cateManual = { |
| 20 | "豆瓣电影Top250": "dbtop250", |
| 21 | "最新电影": "zuixindianying", |
| 22 | "电视剧": "dsj", |
| 23 | "国产剧": "gcj", |
| 24 | "美剧": "meijutt", |
| 25 | "韩剧": "hanjutv", |
| 26 | "番剧": "fanju", |
| 27 | "动漫": "dm" |
| 28 | } |
| 29 | classes = [] |
| 30 | for k in cateManual: |
| 31 | classes.append({ |
| 32 | 'type_name': k, |
| 33 | 'type_id': cateManual[k] |
| 34 | }) |
| 35 | result['class'] = classes |
| 36 | return result |
| 37 | |
| 38 | def homeVideoContent(self): |
| 39 | rsp = self.fetch("https://czspp.com") |
| 40 | root = self.html(self.cleanText(rsp.text)) |
| 41 | aList = root.xpath("//div[@class='mi_btcon']//ul/li") |
| 42 | videos = [] |
| 43 | for a in aList: |
| 44 | name = a.xpath('./a/img/@alt')[0] |
| 45 | pic = a.xpath('./a/img/@data-original')[0] |
| 46 | mark = a.xpath("./div[@class='hdinfo']/span/text()")[0] |
| 47 | sid = a.xpath("./a/@href")[0] |
| 48 | sid = self.regStr(sid, "/movie/(\\S+).html") |
| 49 | videos.append({ |
| 50 | "vod_id": sid, |
| 51 | "vod_name": name, |
| 52 | "vod_pic": pic, |
| 53 | "vod_remarks": mark |
| 54 | }) |
| 55 | result = { |
| 56 | 'list': videos |
| 57 | } |
| 58 | return result |
| 59 | |
| 60 | def categoryContent(self, tid, pg, filter, extend): |
| 61 | result = {} |
| 62 | url = 'https://czspp.com/{0}/page/{1}'.format(tid, pg) |
| 63 | rsp = self.fetch(url) |
| 64 | root = self.html(self.cleanText(rsp.text)) |
| 65 | aList = root.xpath("//div[contains(@class,'mi_cont')]//ul/li") |
| 66 | videos = [] |
nothing calls this directly
no outgoing calls
no test coverage detected