|
@@ -470,34 +470,32 @@ class CloudStorageView(View):
|
|
params={'x-oss-process': 'video/snapshot,t_10000,m_fast,w_300'})
|
|
params={'x-oss-process': 'video/snapshot,t_10000,m_fast,w_300'})
|
|
vod_play_list.append({'name': vod['time'], 'sign_url': vod_play_url, 'thumb': thumb, 'sec': vod['sec']})
|
|
vod_play_list.append({'name': vod['time'], 'sign_url': vod_play_url, 'thumb': thumb, 'sec': vod['sec']})
|
|
elif bucket__mold == 1:
|
|
elif bucket__mold == 1:
|
|
- aws_access_key_id = 'AKIA2E67UIMD45Y3HL53'
|
|
|
|
- aws_secret_access_key = 'ckYLg4Lo9ZXJIcJEAKkzf2rWvs8Xth1FCjqiAqUw'
|
|
|
|
- session = Session(
|
|
|
|
- aws_access_key_id=aws_access_key_id,
|
|
|
|
- aws_secret_access_key=aws_secret_access_key,
|
|
|
|
- region_name=bucket__region
|
|
|
|
- )
|
|
|
|
- conn = session.client('s3')
|
|
|
|
- thumbspng = '{uid}/vod{channel}/{time}/Thumb.jpeg'. \
|
|
|
|
- format(uid=uid, channel=channel, time=vod['time'])
|
|
|
|
- response_url = conn.generate_presigned_url(
|
|
|
|
- 'get_object',
|
|
|
|
- Params={
|
|
|
|
- 'Bucket': bucket_name,
|
|
|
|
- 'Key': thumbspng
|
|
|
|
- },
|
|
|
|
- ExpiresIn=3600
|
|
|
|
- )
|
|
|
|
- thumb_url = response_url
|
|
|
|
- # m3u8 = '{uid}/vod{channel}/{time}/{time}.m3u8'. \
|
|
|
|
|
|
+ # aws_access_key_id = 'AKIA2E67UIMD45Y3HL53'
|
|
|
|
+ # aws_secret_access_key = 'ckYLg4Lo9ZXJIcJEAKkzf2rWvs8Xth1FCjqiAqUw'
|
|
|
|
+ # session = Session(
|
|
|
|
+ # aws_access_key_id=aws_access_key_id,
|
|
|
|
+ # aws_secret_access_key=aws_secret_access_key,
|
|
|
|
+ # region_name=bucket__region
|
|
|
|
+ # )
|
|
|
|
+ # conn = session.client('s3')
|
|
|
|
+ # 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(
|
|
|
|
+ # 'get_object',
|
|
|
|
+ # Params={
|
|
|
|
+ # 'Bucket': bucket_name,
|
|
|
|
+ # 'Key': thumbspng
|
|
|
|
+ # },
|
|
|
|
+ # ExpiresIn=3600
|
|
|
|
+ # )
|
|
|
|
+ # thumb_url = response_url
|
|
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'. \
|
|
format(server_domain=SERVER_DOMAIN,uid=uid, channel=channel, time=vod['time'])
|
|
format(server_domain=SERVER_DOMAIN,uid=uid, channel=channel, time=vod['time'])
|
|
vod_play_list.append({
|
|
vod_play_list.append({
|
|
'name': vod['time'],
|
|
'name': vod['time'],
|
|
'sign_url': vod_url,
|
|
'sign_url': vod_url,
|
|
- 'thumb': thumb_url,
|
|
|
|
|
|
+ # 'thumb': thumb_url,
|
|
'sec': vod['sec']})
|
|
'sec': vod['sec']})
|
|
print('--------------end')
|
|
print('--------------end')
|
|
print(int(time.time()))
|
|
print(int(time.time()))
|