| 8 | import base64 |
| 9 | |
| 10 | class Spider(Spider): |
| 11 | def getName(self): |
| 12 | return "一席" |
| 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 | result = {} |
| 22 | url = 'https://yixi.tv/api/site/category/?_=1' |
| 23 | jo = self.fetch(url,headers=self.header).json() |
| 24 | category = jo['data']['items'] |
| 25 | classes = [] |
| 26 | classes.append({ |
| 27 | 'type_name':'全部', |
| 28 | 'type_id':'' |
| 29 | }) |
| 30 | for cat in category: |
| 31 | classes.append({ |
| 32 | 'type_name':cat['title'], |
| 33 | 'type_id':cat['id'] |
| 34 | }) |
| 35 | result['class'] = classes |
| 36 | if(filter): |
| 37 | result['filters'] = self.config['filter'] |
| 38 | return result |
| 39 | def homeVideoContent(self): |
| 40 | # url = 'https://yixi.tv/api/site/album/?page=1&page_size=4&_=1' |
| 41 | url = 'https://yixi.tv/api/site/album/22/detail/?page=1&page_size=24&_=1' |
| 42 | jo = self.fetch(url,headers=self.header).json() |
| 43 | videos = [] |
| 44 | vodList = jo['data']['items'] |
| 45 | for vod in vodList: |
| 46 | videos.append({ |
| 47 | "vod_id":vod['id'], |
| 48 | "vod_name":vod['title'], |
| 49 | "vod_pic":vod['cover'], |
| 50 | "vod_remarks":vod['time'] |
| 51 | }) |
| 52 | result = { |
| 53 | 'list':videos |
| 54 | } |
| 55 | return result |
| 56 | def categoryContent(self,tid,pg,filter,extend): |
| 57 | result = {} |
| 58 | url = 'https://yixi.tv/api/site/speech/?page={1}&page_size=12&category_id={0}&order_by=0&_=1'.format(tid,pg) |
| 59 | jo = self.fetch(url,headers=self.header).json() |
| 60 | videos = [] |
| 61 | vodList = jo['data']['items'] |
| 62 | for vod in vodList: |
| 63 | videos.append({ |
| 64 | "vod_id":vod['id'], |
| 65 | "vod_name":vod['title'], |
| 66 | "vod_pic":vod['cover'], |
| 67 | "vod_remarks":vod['time'] |
nothing calls this directly
no outgoing calls
no test coverage detected