Jelajahi Sumber

视频号优化

zhangyong 9 bulan lalu
induk
melakukan
41775f76dd
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  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"]: