浏览代码

视频号优化

zhangyong 9 月之前
父节点
当前提交
41775f76dd
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      data_channel/shipinhao.py

+ 6 - 1
data_channel/shipinhao.py

@@ -70,9 +70,14 @@ class SPH:
 
                 response = requests.request("POST", url, headers=headers, data=payload)
                 time.sleep(random.randint(1, 5))
+                res_json = response.json()
+                try:
+                    if len(res_json["DownloadAddress"]) == 0 or res_json["DownloadAddress"] == "" or res_json["DownloadAddress"] == None:
+                        return list
+                except:
+                    pass
                 if "objectId" not in response.text or response.status_code != 200:
                     continue
-                res_json = response.json()
                 if len(res_json["UpMasterHomePage"]) == 0:
                     continue
                 if not res_json["UpMasterHomePage"]: