|
@@ -79,8 +79,9 @@ class testView(View):
|
|
|
elif operation == 'cbu':
|
|
|
return self.createBucket()
|
|
|
elif operation == 'vodList':
|
|
|
+ ip = CommonService.get_ip_address(request)
|
|
|
userID = '158943594633713800138000'
|
|
|
- return self.do_test_query_vod_list(userID, request_dict, response)
|
|
|
+ return self.do_test_query_vod_list(userID, ip, request_dict, response)
|
|
|
elif operation == 'signplaym3u8':
|
|
|
return self.do_sign_play_m3u8(request_dict, response)
|
|
|
elif operation == 'get_sign_sts':
|
|
@@ -112,7 +113,7 @@ class testView(View):
|
|
|
f.write(resp['Body'].read())
|
|
|
|
|
|
|
|
|
- def do_test_query_vod_list(self, userID, request_dict, response):
|
|
|
+ def do_test_query_vod_list(self, userID, ip, request_dict, response):
|
|
|
uid = 'GZL2PEFJPLY7W6BG111A'
|
|
|
channel = 2
|
|
|
userID = '158943594633713800138000'
|
|
@@ -142,9 +143,9 @@ class testView(View):
|
|
|
# m3u8 = '{uid}/vod{channel}/{time}/{time}.m3u8'. \
|
|
|
# format(uid=uid, channel=channel, time=vod['time'])
|
|
|
thumb_url = response_url
|
|
|
- vod_url = 'http://13.56.215.252:8077/testApi/signplaym3u8?' \
|
|
|
+ vod_url = 'http://{ip}:8000/testApi/signplaym3u8?' \
|
|
|
'uid={uid}&channel={channel}&time={time}&sign=tktktktk'. \
|
|
|
- format(uid=uid, channel=channel, time=1590485548)
|
|
|
+ format(ip=ip, uid=uid, channel=channel, time=1590485548)
|
|
|
vod_play_list.append({
|
|
|
'name': 1590485548,
|
|
|
'sign_url': vod_url,
|
|
@@ -190,16 +191,17 @@ class testView(View):
|
|
|
'name': response_url,
|
|
|
'duration': 10,
|
|
|
})
|
|
|
-
|
|
|
playlist = PlaylistGenerator(playlist_entries).generate()
|
|
|
- return HttpResponse(playlist)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- response = HttpResponse(playlist, content_type="application/vnd.apple.mpegurl")
|
|
|
- # response = HttpResponse(playlist, content_type="application/octet-stream")
|
|
|
+ response = HttpResponse(playlist)
|
|
|
+ response['Content-Type'] = 'application/octet-stream'
|
|
|
+ response['Content-Disposition'] = 'attachment;filename="play.m3u8"'
|
|
|
return response
|
|
|
- return HttpResponse(status=200, content=playlist)
|
|
|
+
|
|
|
+ # return HttpResponse(playlist)
|
|
|
+ # response = HttpResponse(playlist, content_type="application/vnd.apple.mpegurl")
|
|
|
+ # # response = HttpResponse(playlist, content_type="application/octet-stream")
|
|
|
+ # return response
|
|
|
+ # return HttpResponse(status=200, content=playlist)
|
|
|
|
|
|
def do_test_get_sign_sts(self, request_dict, ip, response):
|
|
|
# uid = 'GZL2PEFJPLY7W6BG111A'
|