zhangyong 9 tháng trước cách đây
mục cha
commit
737b472b2f
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 6 2
      data_channel/piaoquan.py

+ 6 - 2
data_channel/piaoquan.py

@@ -309,7 +309,11 @@ class PQ:
     @classmethod
     def dd_sph_download_video(cls, video_url, video_path_url, video_id, video, channel_id):
         if channel_id == '单点视频':
-            if video['source'] == "视频号" and int(video['is_encrypted']) == 1:
+            is_encrypted = video.get('is_encrypted', "0")
+            if video['source'] == "视频号" and int(is_encrypted) == 1:
+                decode_key = video['decode_key']
+                if decode_key == None:
+                    return None
                 decode_key = int(video['decode_key'])
                 data, enc_length = None, 0
                 for i in range(3):
@@ -346,7 +350,7 @@ class PQ:
         new_video = video_path_url + str(video_id) + '.mp4'
         for i in range(3):
             try:
-                if video['source'] == "视频号" and int(video['is_encrypted']) == 1:
+                if video['source'] == "视频号" and int(video.get('is_encrypted', "0")) == 1:
                     with open(f"{new_video}", 'wb') as f:
                         f.write(url_video)
                         return new_video