|
|
@@ -197,11 +197,12 @@ def fetch_wx_room_list(request):
|
197
|
197
|
secret = wxcfg.get('appsecret')
|
198
|
198
|
token = access_token(appid, secret)
|
199
|
199
|
|
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'微信直播间列表获取成功')
|
|
200
|
+ rooms = RoomInfo.objects.exclude(Q(live_status=101) | Q(live_status=102))
|
|
201
|
+ start = 0
|
|
202
|
+ if rooms.count() != 0:
|
|
203
|
+ start = int(rooms[0].room_id) - 1
|
203
|
204
|
|
204
|
|
- roominfos = requests.post(url=('http://api.weixin.qq.com/wxa/business/getliveinfo?access_token='+token), json={'start': rooms[0].room_id, 'limit': 100})
|
|
205
|
+ roominfos = requests.post(url=('http://api.weixin.qq.com/wxa/business/getliveinfo?access_token='+token), json={'start': start, 'limit': 100})
|
205
|
206
|
|
206
|
207
|
roominfos = json.loads(roominfos.text).get('room_info', {})
|
207
|
208
|
for roominfo in roominfos:
|