| 62 | return rsp.cookies |
| 63 | |
| 64 | def categoryContent(self,tid,pg,filter,extend): |
| 65 | result = {} |
| 66 | url = 'https://api.bilibili.com/pgc/season/index/result?order=2&season_status=-1&style_id=-1&sort=0&area=-1&pagesize=20&type=1&st={0}&season_type={0}&page={1}'.format(tid,pg) |
| 67 | if len(self.cookies) <= 0: |
| 68 | self.getCookie() |
| 69 | rsp = self.fetch(url, cookies=self.cookies) |
| 70 | content = rsp.text |
| 71 | jo = json.loads(content) |
| 72 | videos = [] |
| 73 | vodList = jo['data']['list'] |
| 74 | for vod in vodList: |
| 75 | aid = str(vod['season_id']).strip() |
| 76 | title = vod['title'].strip() |
| 77 | img = vod['cover'].strip() |
| 78 | remark = vod['index_show'].strip() |
| 79 | videos.append({ |
| 80 | "vod_id":aid, |
| 81 | "vod_name":title, |
| 82 | "vod_pic":img, |
| 83 | "vod_remarks":remark |
| 84 | }) |
| 85 | result['list'] = videos |
| 86 | result['page'] = pg |
| 87 | result['pagecount'] = 9999 |
| 88 | result['limit'] = 90 |
| 89 | result['total'] = 999999 |
| 90 | return result |
| 91 | def cleanSpace(self,str): |
| 92 | return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','') |
| 93 | def detailContent(self,array): |