| 38 | } |
| 39 | return result |
| 40 | def categoryContent(self,tid,pg,filter,extend): |
| 41 | result = {} |
| 42 | month = "" |
| 43 | year = "" |
| 44 | if 'month' in extend.keys(): |
| 45 | month = extend['month'] |
| 46 | if 'year' in extend.keys(): |
| 47 | year = extend['year'] |
| 48 | if year == '': |
| 49 | month = '' |
| 50 | prefix = year + month |
| 51 | extend['p'] = pg |
| 52 | filterMap = { |
| 53 | "fl":"", |
| 54 | "fc":"", |
| 55 | "cid":"", |
| 56 | "p":"1" |
| 57 | } |
| 58 | suffix = "" |
| 59 | for key in filterMap.keys(): |
| 60 | if key in extend.keys(): |
| 61 | filterMap[key] = extend[key] |
| 62 | suffix = suffix + '&' + key + '=' + filterMap[key] |
| 63 | url = 'https://api.cntv.cn/lanmu/columnSearch?{0}&n=20&serviceId=tvcctv&t=json'.format(suffix) |
| 64 | jo = self.fetch(url,headers=self.header).json() |
| 65 | vodList = jo['response']['docs'] |
| 66 | videos = [] |
| 67 | for vod in vodList: |
| 68 | lastVideo = vod['lastVIDE']['videoSharedCode'] |
| 69 | if len(lastVideo) == 0: |
| 70 | lastVideo = '_' |
| 71 | guid = prefix+'###'+vod['column_name']+'###'+lastVideo+'###'+vod['column_logo'] |
| 72 | # guid = prefix+'###'+vod['column_website']+'###'+vod['column_logo'] |
| 73 | title = vod['column_name'] |
| 74 | img = vod['column_logo'] |
| 75 | videos.append({ |
| 76 | "vod_id":guid, |
| 77 | "vod_name":title, |
| 78 | "vod_pic":img, |
| 79 | "vod_remarks":'' |
| 80 | }) |
| 81 | result['list'] = videos |
| 82 | result['page'] = pg |
| 83 | result['pagecount'] = 9999 |
| 84 | result['limit'] = 90 |
| 85 | result['total'] = 999999 |
| 86 | return result |
| 87 | def detailContent(self,array): |
| 88 | aid = array[0].split('###') |
| 89 | tid = aid[0] |