| 8 | import base64 |
| 9 | |
| 10 | class Spider(Spider): # 元类 默认的元类 type |
| 11 | def getName(self): |
| 12 | return "Voflix" |
| 13 | def init(self,extend=""): |
| 14 | print("============{0}============".format(extend)) |
| 15 | pass |
| 16 | def isVideoFormat(self,url): |
| 17 | pass |
| 18 | def manualVideoCheck(self): |
| 19 | pass |
| 20 | def homeContent(self,filter): |
| 21 | # https://meijuchong.cc/ |
| 22 | result = {} |
| 23 | cateManual = { |
| 24 | "电影": "1", |
| 25 | "剧集": "2", |
| 26 | "综艺": "3", |
| 27 | "动漫": "4" |
| 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 | if(filter): |
| 37 | result['filters'] = self.config['filter'] |
| 38 | return result |
| 39 | def homeVideoContent(self): |
| 40 | rsp = self.fetch("https://www.voflix.com/",headers=self.header) |
| 41 | root = self.html(rsp.text) |
| 42 | vodList = root.xpath("//div[@class='module']/div[contains(@class,'tab-list')]//a") |
| 43 | videos = [] |
| 44 | for vod in vodList: |
| 45 | name = vod.xpath("./@title")[0] |
| 46 | pic = vod.xpath(".//img/@data-original")[0] |
| 47 | mark = vod.xpath(".//div[@class='module-item-note']/text()")[0] |
| 48 | sid = vod.xpath("./@href")[0] |
| 49 | sid = self.regStr(sid,"/detail/(\\S+).html") |
| 50 | videos.append({ |
| 51 | "vod_id":sid, |
| 52 | "vod_name":name, |
| 53 | "vod_pic":pic, |
| 54 | "vod_remarks":mark |
| 55 | }) |
| 56 | result = { |
| 57 | 'list':videos |
| 58 | } |
| 59 | return result |
| 60 | def categoryContent(self,tid,pg,filter,extend): |
| 61 | result = {} |
| 62 | if 'id' not in extend.keys(): |
| 63 | extend['id'] = tid |
| 64 | extend['page'] = pg |
| 65 | filterParams = ["id", "area", "by", "class", "", "", "", "", "page", "", "", "year"] |
| 66 | params = ["", "", "", "", "", "", "", "", "", "", "", ""] |
| 67 | for idx in range(len(filterParams)): |
nothing calls this directly
no outgoing calls
no test coverage detected