mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
修复部分站点邀请熟练高阶细错误的bug,邀请数量显示为永久药+临时药总数
This commit is contained in:
14
pt.json
14
pt.json
@@ -1426,7 +1426,7 @@
|
||||
"pk": 23,
|
||||
"fields": {
|
||||
"created_at": "2022-07-20T11:25:55.869",
|
||||
"updated_at": "2022-11-17T20:05:49.361",
|
||||
"updated_at": "2022-11-22T12:46:24.470",
|
||||
"url": "https://www.hitpt.com/",
|
||||
"name": "百川",
|
||||
"logo": "https://www.hitpt.com/favicon.ico",
|
||||
@@ -1478,7 +1478,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//table/tr[1]/td[2]/a/text()",
|
||||
"invitation_rule": "//a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"time_join_rule": "//table/tr[2]/td[2]/span/@title",
|
||||
"latest_active_rule": "//table/tr[3]/td[2]/span/@title",
|
||||
"uploaded_rule": "//tr[6]/td[2]/table/tr[2]/td[1]/text()",
|
||||
@@ -1821,7 +1821,7 @@
|
||||
"pk": 29,
|
||||
"fields": {
|
||||
"created_at": "2022-07-20T23:51:54.709",
|
||||
"updated_at": "2022-11-17T20:05:49.379",
|
||||
"updated_at": "2022-11-22T13:06:23.674",
|
||||
"url": "https://www.haidan.video/",
|
||||
"name": "海胆",
|
||||
"logo": "https://www.haidan.video/public/pic/favicon.ico",
|
||||
@@ -1873,7 +1873,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "因种子的分组机构原因,暂未支持",
|
||||
"invitation_rule": "//span/a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"invitation_rule": "//td[text()=\"邀请\"]/following-sibling::td/text()",
|
||||
"time_join_rule": "//td[contains(text(),\"加入\")]/following-sibling::td[1]//span/@title",
|
||||
"latest_active_rule": "//td[contains(text(),\"最近\")]/following-sibling::td[1]//span/@title",
|
||||
"uploaded_rule": "//font[@class=\"color_uploaded\"]/following-sibling::text()[1]",
|
||||
@@ -3164,7 +3164,7 @@
|
||||
"pk": 47,
|
||||
"fields": {
|
||||
"created_at": "2022-08-26T20:54:35.357",
|
||||
"updated_at": "2022-11-17T20:05:49.439",
|
||||
"updated_at": "2022-11-22T12:38:01.287",
|
||||
"url": "https://discfan.net/",
|
||||
"name": "蝶粉",
|
||||
"logo": "https://discfan.net/favicon.ico",
|
||||
@@ -3717,7 +3717,7 @@
|
||||
"pk": 54,
|
||||
"fields": {
|
||||
"created_at": "2022-08-27T18:24:32.917",
|
||||
"updated_at": "2022-11-20T22:35:59.512",
|
||||
"updated_at": "2022-11-22T12:51:28.121",
|
||||
"url": "https://www.open.cd/",
|
||||
"name": "OpenCD",
|
||||
"logo": "https://www.open.cd/favicon.ico",
|
||||
@@ -3769,7 +3769,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"invitation_rule": "//font[@class=\"color_invite\"]/following-sibling::text()[1]",
|
||||
"time_join_rule": "//td[contains(text(),\"加入\")]/following-sibling::td/span/@title",
|
||||
"latest_active_rule": "//td[contains(text(),\"最近动向\")]/following-sibling::td/span/@title",
|
||||
"uploaded_rule": "//font[@class=\"color_uploaded\"]/following-sibling::text()[1]",
|
||||
|
||||
@@ -1566,7 +1566,8 @@ class PtSpider:
|
||||
invitation = ''.join(
|
||||
details_html.xpath(site.invitation_rule)
|
||||
).strip(']:').replace('[', '').strip()
|
||||
invitation = re.sub("\D", "", invitation)
|
||||
logger.info(invitation)
|
||||
# invitation = re.sub("\D", "", invitation)
|
||||
# time_join_1 = ''.join(
|
||||
# details_html.xpath(site.time_join_rule)
|
||||
# ).split('(')[0].strip('\xa0').strip()
|
||||
@@ -1627,10 +1628,15 @@ class PtSpider:
|
||||
# logger.info(my_bonus)
|
||||
# 更新我的站点数据
|
||||
invitation = converter.convert(invitation)
|
||||
invitation = re.sub('[\u4e00-\u9fa5]', '', invitation)
|
||||
# x = invitation.split('/')
|
||||
# invitation = re.sub('[\u4e00-\u9fa5]', '', invitation)
|
||||
logger.info(invitation)
|
||||
if invitation == '没有邀请资格':
|
||||
invitation = 0
|
||||
my_site.invitation = int(invitation) if invitation else 0
|
||||
my_site.invitation = 0
|
||||
else:
|
||||
invitation_list = [int(n) for n in invitation.split('/')]
|
||||
# my_site.invitation = int(invitation) if invitation else 0
|
||||
my_site.invitation = sum(invitation_list)
|
||||
|
||||
my_site.latest_active = datetime.now()
|
||||
my_site.my_level = my_level if my_level != '' else ' '
|
||||
|
||||
@@ -1370,7 +1370,7 @@
|
||||
{
|
||||
"id": 23,
|
||||
"created_at": "2022-07-20 11:25:55.869000",
|
||||
"updated_at": "2022-11-17 20:05:49.361896",
|
||||
"updated_at": "2022-11-22 12:46:24.470015",
|
||||
"name": "百川",
|
||||
"url": "https://www.hitpt.com/",
|
||||
"logo": "https://www.hitpt.com/favicon.ico",
|
||||
@@ -1420,7 +1420,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//table/tr[1]/td[2]/a/text()",
|
||||
"invitation_rule": "//a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"time_join_rule": "//table/tr[2]/td[2]/span/@title",
|
||||
"latest_active_rule": "//table/tr[3]/td[2]/span/@title",
|
||||
"uploaded_rule": "//tr[6]/td[2]/table/tr[2]/td[1]/text()",
|
||||
@@ -1750,7 +1750,7 @@
|
||||
{
|
||||
"id": 29,
|
||||
"created_at": "2022-07-20 23:51:54.709000",
|
||||
"updated_at": "2022-11-17 20:05:49.379188",
|
||||
"updated_at": "2022-11-22 13:06:23.674054",
|
||||
"name": "海胆",
|
||||
"url": "https://www.haidan.video/",
|
||||
"logo": "https://www.haidan.video/public/pic/favicon.ico",
|
||||
@@ -1800,7 +1800,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "因种子的分组机构原因,暂未支持",
|
||||
"invitation_rule": "//span/a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"invitation_rule": "//td[text()=\"邀请\"]/following-sibling::td/text()",
|
||||
"time_join_rule": "//td[contains(text(),\"加入\")]/following-sibling::td[1]//span/@title",
|
||||
"latest_active_rule": "//td[contains(text(),\"最近\")]/following-sibling::td[1]//span/@title",
|
||||
"uploaded_rule": "//font[@class=\"color_uploaded\"]/following-sibling::text()[1]",
|
||||
@@ -3042,7 +3042,7 @@
|
||||
{
|
||||
"id": 47,
|
||||
"created_at": "2022-08-26 20:54:35.357000",
|
||||
"updated_at": "2022-11-17 20:05:49.439065",
|
||||
"updated_at": "2022-11-22 12:38:01.287074",
|
||||
"name": "蝶粉",
|
||||
"url": "https://discfan.net/",
|
||||
"logo": "https://discfan.net/favicon.ico",
|
||||
@@ -3574,7 +3574,7 @@
|
||||
{
|
||||
"id": 54,
|
||||
"created_at": "2022-08-27 18:24:32.917000",
|
||||
"updated_at": "2022-11-20 22:35:59.512639",
|
||||
"updated_at": "2022-11-22 12:51:28.121692",
|
||||
"name": "OpenCD",
|
||||
"url": "https://www.open.cd/",
|
||||
"logo": "https://www.open.cd/favicon.ico",
|
||||
@@ -3624,7 +3624,7 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"invitation_rule": "//font[@class=\"color_invite\"]/following-sibling::text()[1]",
|
||||
"time_join_rule": "//td[contains(text(),\"加入\")]/following-sibling::td/span/@title",
|
||||
"latest_active_rule": "//td[contains(text(),\"最近动向\")]/following-sibling::td/span/@title",
|
||||
"uploaded_rule": "//font[@class=\"color_uploaded\"]/following-sibling::text()[1]",
|
||||
|
||||
Reference in New Issue
Block a user