MCPcopy Create free account
hub / github.com/UndCover/PyramidStore / categoryContent

Method categoryContent

plugin/py_cctv.py:46–80  ·  view source on GitHub ↗
(self,tid,pg,filter,extend)

Source from the content-addressed store, hash-verified

44 }
45 return result
46 def categoryContent(self,tid,pg,filter,extend):
47 result = {}
48 extend['id'] = tid
49 extend['p'] = pg
50 filterParams = ["id", "p", "d"]
51 params = ["", "", ""]
52 for idx in range(len(filterParams)):
53 fp = filterParams[idx]
54 if fp in extend.keys():
55 params[idx] = '{0}={1}'.format(filterParams[idx],extend[fp])
56 suffix = '&'.join(params)
57 url = 'https://api.cntv.cn/NewVideo/getVideoListByColumn?{0}&n=20&sort=desc&mode=0&serviceId=tvcctv&t=json'.format(suffix)
58 if not tid.startswith('TOPC'):
59 url = 'https://api.cntv.cn/NewVideo/getVideoListByAlbumIdNew?{0}&n=20&sort=desc&mode=0&serviceId=tvcctv&t=json'.format(suffix)
60 rsp = self.fetch(url,headers=self.header)
61 jo = json.loads(rsp.text)
62 vodList = jo['data']['list']
63 videos = []
64 for vod in vodList:
65 guid = vod['guid']
66 title = vod['title']
67 img = vod['image']
68 brief = vod['brief']
69 videos.append({
70 "vod_id":guid+"###"+img,
71 "vod_name":title,
72 "vod_pic":img,
73 "vod_remarks":''
74 })
75 result['list'] = videos
76 result['page'] = pg
77 result['pagecount'] = 9999
78 result['limit'] = 90
79 result['total'] = 999999
80 return result
81 def detailContent(self,array):
82 aid = array[0].split('###')
83 tid = aid[0]

Callers

nothing calls this directly

Calls 1

fetchMethod · 0.95

Tested by

no test coverage detected