diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py index 9460df1..fa4c38d 100644 --- a/utils/HtmlUtils.py +++ b/utils/HtmlUtils.py @@ -68,9 +68,6 @@ class htmlUtils: try: print(f"请求地址:{curl}") res = s.get(curl,stream=True, headers=cls.headers, timeout=10,allow_redirects=True) - if res.status_code != 200: - cls.remove_HtmlCache(curl) - continue if type == "bytes": url_text = res if type == "json": @@ -85,6 +82,7 @@ class htmlUtils: cls.saveHtml(curl,res.text) except: print(f'Retry! 第{count}次') + cls.remove_HtmlCache(curl) time.sleep(1) traceback.print_exc() count += 1