浏览代码

delete thumb

lang 4 年之前
父节点
当前提交
b590533f93
共有 1 个文件被更改,包括 25 次插入21 次删除
  1. 25 21
      Controller/CloudStorage.py

+ 25 - 21
Controller/CloudStorage.py

@@ -413,9 +413,11 @@ class CloudStorageView(View):
             (uid=uid, channel=channel, time__range=(startTime, endTime), endTime__gte=now_time). \
             values("time", "sec", "bucket__bucket", "bucket__endpoint", "bucket__region", "bucket__mold")
         vod_play_list = []
-        print("---")
+        print("-------------vh_qs")
         print(vh_qs)
         auth = oss2.Auth(OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET)
+        print('--------------bigin')
+        print(int(time.time()))
         for vod in vh_qs:
             bucket__mold = vod["bucket__mold"]
             bucket_name = vod["bucket__bucket"]
@@ -437,35 +439,37 @@ class CloudStorageView(View):
                                         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']})
             elif bucket__mold == 1:
-                aws_access_key_id = 'AKIA2E67UIMD45Y3HL53'
-                aws_secret_access_key = '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'
-                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}/thumbs.png'. \
-                    format(uid=uid, channel=channel, time=vod['time'])
-                response_url = conn.generate_presigned_url(
-                    'get_object',
-                    Params={
-                        'Bucket': bucket_name,
-                        'Key': thumbspng
-                    },
-                    ExpiresIn=3600
-                )
+                # aws_access_key_id = 'AKIA2E67UIMD45Y3HL53'
+                # aws_secret_access_key = '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'
+                # 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}/thumbs.png'. \
+                #     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'. \
                 #     format(uid=uid, channel=channel, time=vod['time'])
-                thumb_url = response_url
                 vod_url = 'http://cloudstroage.dvema.com/cloudstorage/signplaym3u8?' \
                           'uid={uid}&channel={channel}&time={time}&sign=tktktktk'. \
                     format(uid=uid, channel=channel, time=vod['time'])
                 vod_play_list.append({
                     'name': vod['time'],
                     'sign_url': vod_url,
-                    'thumb': thumb_url,
+                    # 'thumb': thumb_url,
                     'sec': vod['sec']})
+        print('--------------end')
+        print(int(time.time()))
         return response.json(0, vod_play_list)
 
     def do_store_playlist(self, request_dict, response):