From 3b848349f1dd72ecf05536edfe3e293987464a46 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 20 Dec 2022 13:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=86=99=E5=85=A5HOSTS?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=AC=E6=A8=B1=E7=AD=BE=E5=88=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 3 ++- start.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index bdd3e29..84fe06c 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -7,6 +7,7 @@ import ssl import threading import time import traceback +from _ssl import CERT_NONE from datetime import datetime from urllib.request import urlopen @@ -197,7 +198,7 @@ class PtSpider: _RESTRICTED_SERVER_CIPHERS = 'ALL' ssl_context.set_ciphers(_RESTRICTED_SERVER_CIPHERS) ssl_context.check_hostname = False - ssl_context.verify_mode = False + ssl_context.verify_mode = CERT_NONE scraper.ssl_context = ssl_context headers = { 'User-Agent': my_site.user_agent, diff --git a/start.sh b/start.sh index d1e0b2d..9a84250 100644 --- a/start.sh +++ b/start.sh @@ -54,6 +54,9 @@ echo 104.25.26.31 share.dmhy.org >>/etc/hosts echo 104.25.61.106 share.dmhy.org >>/etc/hosts echo 104.25.62.106 share.dmhy.org >>/etc/hosts echo 172.67.98.15 share.dmhy.org >>/etc/hosts +echo 172.67.98.15 share.dmhy.org >>/etc/hosts +echo "写入冬樱HOSTS" +echo 217.79.189.238 wintersakura.net >>/etc/hosts echo "启动服务" python manage.py migrate python manage.py runserver 0.0.0.0:$DJANGO_WEB_PORT