| 91 | def cleanSpace(self,str): |
| 92 | return str.replace('\n','').replace('\t','').replace('\r','').replace(' ','') |
| 93 | def detailContent(self,array): |
| 94 | aid = array[0] |
| 95 | url = "http://api.bilibili.com/pgc/view/web/season?season_id={0}".format(aid) |
| 96 | rsp = self.fetch(url,headers=self.header) |
| 97 | jRoot = json.loads(rsp.text) |
| 98 | jo = jRoot['result'] |
| 99 | id = jo['season_id'] |
| 100 | title = jo['title'] |
| 101 | pic = jo['cover'] |
| 102 | areas = jo['areas'][0]['name'] |
| 103 | typeName = jo['share_sub_title'] |
| 104 | dec = jo['evaluate'] |
| 105 | remark = jo['new_ep']['desc'] |
| 106 | vod = { |
| 107 | "vod_id":id, |
| 108 | "vod_name":title, |
| 109 | "vod_pic":pic, |
| 110 | "type_name":typeName, |
| 111 | "vod_year":"", |
| 112 | "vod_area":areas, |
| 113 | "vod_remarks":remark, |
| 114 | "vod_actor":"", |
| 115 | "vod_director":"", |
| 116 | "vod_content":dec |
| 117 | } |
| 118 | ja = jo['episodes'] |
| 119 | playUrl = '' |
| 120 | for tmpJo in ja: |
| 121 | eid = tmpJo['id'] |
| 122 | cid = tmpJo['cid'] |
| 123 | part = tmpJo['title'].replace("#", "-") |
| 124 | playUrl = playUrl + '{0}${1}_{2}#'.format(part, eid, cid) |
| 125 | |
| 126 | vod['vod_play_from'] = 'B站影视' |
| 127 | vod['vod_play_url'] = playUrl |
| 128 | |
| 129 | result = { |
| 130 | 'list':[ |
| 131 | vod |
| 132 | ] |
| 133 | } |
| 134 | return result |
| 135 | def searchContent(self,key,quick): |
| 136 | url = 'https://api.bilibili.com/x/web-interface/search/type?search_type=media_bangumi&keyword={0}'.format(key) # 番剧搜索 |
| 137 | if len(self.cookies) <= 0: |