瀏覽代碼

回放列表UID 加密

chenshibin 4 年之前
父節點
當前提交
338cc9aa0c
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Controller/CloudStorage.py

+ 3 - 1
Controller/CloudStorage.py

@@ -11,6 +11,7 @@
 @file: cloudstorage.py
 @Contact: chanjunkai@163.com
 """
+import base64
 import json
 import os
 import time
@@ -252,6 +253,7 @@ class CloudStorageView(View):
 
     def do_sign_play_m3u8(self, request_dict, response):
         uid = request_dict.get('uid', None)
+        uid = base64.b64decode(uid).decode("utf-8")
         channel = request_dict.get('channel', None)
         storeTime = request_dict.get('time', None)
         now_time = int(time.time())
@@ -465,7 +467,7 @@ class CloudStorageView(View):
             )
             vod_url = '{server_domain}/cloudstorage/signplaym3u8?' \
                       '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=base64.b64encode(uid), channel=channel, time=vod['time'])
             ts_num = int(vod['fg']) & 0xf
             vod_play_list.append({
                 'name': vod['time'],