|
|
@@ -198,6 +198,9 @@ def fetch_wx_room_list(request):
|
198
|
198
|
token = access_token(appid, secret)
|
199
|
199
|
|
200
|
200
|
rooms = RoomInfo.objects.filter(Q(live_status=101) | Q(live_status=102))
|
|
201
|
+ if rooms.count() == 0:
|
|
202
|
+ return response(200, 'Fetch wx Room List Success', u'微信直播间列表获取成功')
|
|
203
|
+
|
201
|
204
|
roominfos = requests.post(url=('http://api.weixin.qq.com/wxa/business/getliveinfo?access_token='+token), json={'start': rooms[0].room_id, 'limit': 100})
|
202
|
205
|
|
203
|
206
|
roominfos = json.loads(roominfos.text).get('room_info', {})
|