|
@@ -12,31 +12,26 @@
|
|
@Contact: chanjunkai@163.com
|
|
@Contact: chanjunkai@163.com
|
|
"""
|
|
"""
|
|
import json
|
|
import json
|
|
-import math
|
|
|
|
import time
|
|
import time
|
|
import urllib
|
|
import urllib
|
|
-from Object.AliPayObject import AliPayObject
|
|
|
|
|
|
+
|
|
|
|
+import boto3
|
|
import oss2
|
|
import oss2
|
|
import paypalrestsdk
|
|
import paypalrestsdk
|
|
-import boto3
|
|
|
|
from aliyunsdkcore import client
|
|
from aliyunsdkcore import client
|
|
from aliyunsdksts.request.v20150401 import AssumeRoleRequest
|
|
from aliyunsdksts.request.v20150401 import AssumeRoleRequest
|
|
|
|
+from boto3.session import Session
|
|
from django.http import JsonResponse, HttpResponseRedirect, HttpResponse
|
|
from django.http import JsonResponse, HttpResponseRedirect, HttpResponse
|
|
-from django.utils.decorators import method_decorator
|
|
|
|
-from django.views.decorators.csrf import csrf_exempt
|
|
|
|
from django.views.generic.base import View
|
|
from django.views.generic.base import View
|
|
|
|
|
|
from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, OSS_ROLE_ARN, SERVER_DOMAIN, PAYPAL_CRD, \
|
|
from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, OSS_ROLE_ARN, SERVER_DOMAIN, PAYPAL_CRD, \
|
|
SERVER_DOMAIN_SSL
|
|
SERVER_DOMAIN_SSL
|
|
from Model.models import Device_Info, Order_Model, Store_Meal, VodHlsModel, OssCrdModel, UID_Bucket, StsCrdModel
|
|
from Model.models import Device_Info, Order_Model, Store_Meal, VodHlsModel, OssCrdModel, UID_Bucket, StsCrdModel
|
|
|
|
+from Object.AliPayObject import AliPayObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.ResponseObject import ResponseObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.TokenObject import TokenObject
|
|
from Object.UidTokenObject import UidTokenObject
|
|
from Object.UidTokenObject import UidTokenObject
|
|
from Service.CommonService import CommonService
|
|
from Service.CommonService import CommonService
|
|
-from Service.ModelService import ModelService
|
|
|
|
-from Object.ETkObject import ETkObject
|
|
|
|
-from boto3.session import Session
|
|
|
|
-import boto3
|
|
|
|
|
|
|
|
SERVER_DOMAIN = 'http://cloudstroage.dvema.com/'
|
|
SERVER_DOMAIN = 'http://cloudstroage.dvema.com/'
|
|
|
|
|
|
@@ -67,6 +62,8 @@ class CloudStorageView(View):
|
|
return self.do_get_sign_sts(request_dict, ip, response)
|
|
return self.do_get_sign_sts(request_dict, ip, response)
|
|
elif operation == 'storeplaylist':
|
|
elif operation == 'storeplaylist':
|
|
return self.do_store_playlist(request_dict, response)
|
|
return self.do_store_playlist(request_dict, response)
|
|
|
|
+ elif operation == 'getsignurl/play.m3u8':
|
|
|
|
+ return self.do_get_sign_url_m3u8(request_dict, response)
|
|
else:
|
|
else:
|
|
token = request_dict.get('token', None)
|
|
token = request_dict.get('token', None)
|
|
# 设备主键uid
|
|
# 设备主键uid
|
|
@@ -84,6 +81,9 @@ class CloudStorageView(View):
|
|
else:
|
|
else:
|
|
return response.json(414)
|
|
return response.json(414)
|
|
|
|
|
|
|
|
+ def do_get_sign_url_m3u8(self, request_dict, response):
|
|
|
|
+ return
|
|
|
|
+
|
|
def do_get_sign_sts(self, request_dict, ip, response):
|
|
def do_get_sign_sts(self, request_dict, ip, response):
|
|
uidToken = request_dict.get('uidToken', None)
|
|
uidToken = request_dict.get('uidToken', None)
|
|
utko = UidTokenObject(uidToken)
|
|
utko = UidTokenObject(uidToken)
|
|
@@ -287,8 +287,7 @@ class CloudStorageView(View):
|
|
# m3u8 = '{uid}/vod{channel}/{time}/{time}.m3u8'. \
|
|
# m3u8 = '{uid}/vod{channel}/{time}/{time}.m3u8'. \
|
|
# format(uid=uid, channel=channel, time=vod['time'])
|
|
# format(uid=uid, channel=channel, time=vod['time'])
|
|
thumb_url = response_url
|
|
thumb_url = response_url
|
|
- vod_url = 'http://cloudstroage.dvema.com/getsignurl/' \
|
|
|
|
- 'play.m3u8?uid={uid}&channel={channel}&time={time}'. \
|
|
|
|
|
|
+ vod_url = 'http://cloudstroage.dvema.com/getsignurl/play.m3u8?uid={uid}&channel={channel}&time={time}&sign=tktktktk'. \
|
|
format(uid=uid, channel=channel, time=time)
|
|
format(uid=uid, channel=channel, time=time)
|
|
vod_play_list.append({
|
|
vod_play_list.append({
|
|
'name': vod['time'],
|
|
'name': vod['time'],
|
|
@@ -298,7 +297,6 @@ class CloudStorageView(View):
|
|
return response.json(0, vod_play_list)
|
|
return response.json(0, vod_play_list)
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
def do_store_playlist(self, request_dict, response):
|
|
def do_store_playlist(self, request_dict, response):
|
|
uidToken = request_dict.get('uidToken', None)
|
|
uidToken = request_dict.get('uidToken', None)
|
|
storeTime = request_dict.get('time', None)
|
|
storeTime = request_dict.get('time', None)
|