From 3398493f7c4ab4f5f73e570728893d88f4f62a04 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Thu, 13 Oct 2022 14:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8IP=E8=AE=BF=E9=97=AE=E5=AD=A6?= =?UTF-8?q?=E6=A0=A1=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=A0=B4=E7=9B=BE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_pt_site_site.json | 6 +++--- pt.json | 6 +++--- pt_site/UtilityTool.py | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/main_pt_site_site.json b/main_pt_site_site.json index f1817d0..30250d4 100644 --- a/main_pt_site_site.json +++ b/main_pt_site_site.json @@ -154,12 +154,12 @@ { "id": 3, "created_at": "2022-07-17 10:24:59.754000", - "updated_at": "2022-09-28 14:19:49.685000", + "updated_at": "2022-10-13 13:48:43.145285", "name": "BT学校", - "url": "https://pt.btschool.club/", + "url": "http://47.242.110.63/", "logo": "https://pt.btschool.club/favicon.ico", "sign_in_support": 1, - "get_torrent_support": 0, + "get_torrent_support": 1, "get_userinfo_support": 1, "search_support": 0, "page_default": "torrents.php", diff --git a/pt.json b/pt.json index 93e2f71..95f2f8b 100644 --- a/pt.json +++ b/pt.json @@ -162,13 +162,13 @@ "pk": 3, "fields": { "created_at": "2022-07-17T10:24:59.754", - "updated_at": "2022-09-28T14:19:49.685", - "url": "https://pt.btschool.club/", + "updated_at": "2022-10-13T13:48:43.145", + "url": "http://47.242.110.63/", "name": "BT学校", "logo": "https://pt.btschool.club/favicon.ico", "tracker": "btschool.club", "sign_in_support": true, - "get_torrent_support": false, + "get_torrent_support": true, "get_userinfo_support": true, "search_support": false, "page_default": "torrents.php", diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index 97c6720..6e234bb 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -866,7 +866,7 @@ class PtSpider: ) res = self.send_request(my_site=my_site, method=site.sign_in_method, url=url, data=eval(site.sign_in_params)) - logger.info(res.text) + logger.info(res.status_code) if 'hares.top' in site.url: code = res.json().get('code') # logger.info('白兔返回码:'+ type(code)) @@ -906,9 +906,16 @@ class PtSpider: return CommonResponse.error( status=StatusCodeEnum.FAILED_SIGN_IN ) - if 'btschool' in site.url: + if '47.242.110.63' in site.url: + logger.info(res.status_code) logger.info(res.content.decode('utf-8')) - text = self.parse(res, '//script/text()') + text = self.parse(res, '//a[@href="index.php"]/font/text()') + signin_stat = self.parse(res, '//a[contains(@href,"addbouns"])') + logger.info('{}:{}'.format(site.name, text)) + if len(signin_stat) <= 0: + return CommonResponse.success(msg=text) + """ + # text = self.parse(res, '//script/text()') if len(text) > 0: location = self.parse_school_location(text) logger.info('学校签到链接:' + location) @@ -931,7 +938,8 @@ class PtSpider: signin_today.save() return CommonResponse.success(msg='签到成功!') else: - return CommonResponse.error(msg='签到失败!') + """ + return CommonResponse.error(msg='签到失败或网络错误!') if res.status_code == 200: status = converter.convert(res.content.decode('utf8')) # status = ''.join(self.parse(res, '//a[contains(@href,{})]/text()'.format(site.page_sign_in)))