From 04eefd080447e78174bf3d80e01bae79fead946e Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 20 Sep 2022 22:48:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E5=AE=9E=E6=95=B0=E6=8D=AE=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E6=98=AF=E5=BC=95=E8=B5=B7=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=94=81=E7=9A=84=E6=9C=80=E4=BA=8F=E7=A5=B8=E9=A6=96=EF=BC=8C?= =?UTF-8?q?=E8=AE=A9=E6=88=91=E6=9C=89=E7=82=B9=E6=83=B3=E4=B8=8D=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index c9a8b29..8bf2cde 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -10,7 +10,6 @@ import aip import cloudscraper import dateutil.parser import opencc -from django.db import transaction from django.db.models import QuerySet from lxml import etree from pypushdeer import PushDeer @@ -261,7 +260,7 @@ class PtSpider: # raise return CommonResponse.error(msg='Cookies解析失败,请确认导入了正确的cookies备份文件!') - @transaction.atomic + # @transaction.atomic def get_uid_and_passkey(self, cookie: dict): url = cookie.get('url') host = cookie.get('host') @@ -413,7 +412,7 @@ class PtSpider: print(response.content.decode('utf8')) return CommonResponse.success(data=response) except Exception as e: - raise + # raise return CommonResponse.success( status=StatusCodeEnum.WEB_CONNECT_ERR, msg=site.name + str(e) @@ -550,7 +549,7 @@ class PtSpider: logging.error(my_site.site.name + '签到失败!原因:' + result.msg) return message_list - @transaction.atomic + # @transaction.atomic def sign_in(self, my_site: MySite): """签到""" site = my_site.site @@ -734,7 +733,7 @@ class PtSpider: else: return CommonResponse.error(msg='请确认签到是否成功??网页返回码:' + str(res.status_code)) except Exception as e: - raise + # raise self.send_text(site.name + '签到失败!原因:' + str(e)) return CommonResponse.error(msg='签到失败!' + str(e)) @@ -760,7 +759,7 @@ class PtSpider: self.send_text(site.name + '网站访问失败!原因:' + str(e)) return CommonResponse.error(msg="网站访问失败" + str(e)) - @transaction.atomic + # @transaction.atomic def get_torrent_info_list(self, my_site: MySite, response: Response): count = 0 new_count = 0 @@ -1068,7 +1067,7 @@ class PtSpider: count = 0 return int(count) - @transaction.atomic + # @transaction.atomic def parse_status_html(self, my_site: MySite, result: dict): """解析个人状态""" with lock: