|
@@ -18,6 +18,7 @@ import urllib
|
|
import boto3
|
|
import boto3
|
|
import oss2
|
|
import oss2
|
|
import paypalrestsdk
|
|
import paypalrestsdk
|
|
|
|
+import threading
|
|
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 boto3.session import Session
|
|
@@ -207,8 +208,7 @@ class CloudStorageView(View):
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
vh_qs = VodHlsModel.objects.filter(uid=uid, channel=channel, time=storeTime, endTime__gte=now_time). \
|
|
vh_qs = VodHlsModel.objects.filter(uid=uid, channel=channel, time=storeTime, endTime__gte=now_time). \
|
|
values("sec", "fg", "bucket__bucket", "bucket__endpoint", "bucket__region", "bucket__mold")
|
|
values("sec", "fg", "bucket__bucket", "bucket__endpoint", "bucket__region", "bucket__mold")
|
|
- if not vh_qs.exists():
|
|
|
|
- return response.json(11,'不存在.')
|
|
|
|
|
|
+ if not vh_qs.exists(): return response.json(11,'不存在.')
|
|
sec = vh_qs[0]['sec']
|
|
sec = vh_qs[0]['sec']
|
|
fg = vh_qs[0]['fg']
|
|
fg = vh_qs[0]['fg']
|
|
bucket__region = vh_qs[0]['bucket__region']
|
|
bucket__region = vh_qs[0]['bucket__region']
|
|
@@ -443,6 +443,10 @@ class CloudStorageView(View):
|
|
( uid=uid, channel=channel, time__range=(startTime, endTime), endTime__gte=now_time). \
|
|
( uid=uid, channel=channel, time__range=(startTime, endTime), endTime__gte=now_time). \
|
|
values("time", "sec", "bucket__bucket", "fg", "bucket__endpoint", "bucket__region", "bucket__mold")
|
|
values("time", "sec", "bucket__bucket", "fg", "bucket__endpoint", "bucket__region", "bucket__mold")
|
|
vod_play_list = []
|
|
vod_play_list = []
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
print(int(time.time()))
|
|
print(int(time.time()))
|
|
for vod in vh_qs:
|
|
for vod in vh_qs:
|
|
bucket__mold = vod["bucket__mold"]
|
|
bucket__mold = vod["bucket__mold"]
|
|
@@ -474,6 +478,7 @@ class CloudStorageView(View):
|
|
# region_name=bucket__region
|
|
# region_name=bucket__region
|
|
# )
|
|
# )
|
|
# conn = session.client('s3')
|
|
# conn = session.client('s3')
|
|
|
|
+
|
|
# thumbspng = '{uid}/vod{channel}/{time}/Thumb.jpeg'. \
|
|
# thumbspng = '{uid}/vod{channel}/{time}/Thumb.jpeg'. \
|
|
# format(uid=uid, channel=channel, time=vod['time'])
|
|
# format(uid=uid, channel=channel, time=vod['time'])
|
|
# response_url = conn.generate_presigned_url(
|
|
# response_url = conn.generate_presigned_url(
|
|
@@ -485,6 +490,7 @@ class CloudStorageView(View):
|
|
# ExpiresIn=3600
|
|
# ExpiresIn=3600
|
|
# )
|
|
# )
|
|
# thumb_url = response_url
|
|
# thumb_url = response_url
|
|
|
|
+ # format(uid=uid, channel=channel, time=vod['time'])
|
|
|
|
|
|
vod_url = '{server_domain}/cloudstorage/signplaym3u8?' \
|
|
vod_url = '{server_domain}/cloudstorage/signplaym3u8?' \
|
|
'uid={uid}&channel={channel}&time={time}&sign=tktktktk'. \
|
|
'uid={uid}&channel={channel}&time={time}&sign=tktktktk'. \
|