mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 更新默认规则
2. 本次更新重启后生效
This commit is contained in:
@@ -234,12 +234,12 @@ def do_update_xpath(request):
|
||||
print(data[0].get('url'))
|
||||
xpath_update = []
|
||||
print('更新规则中,返回结果为True为新建,为False为更新,其他是错误了')
|
||||
for site in data:
|
||||
if site.get('pk'):
|
||||
del site['pk']
|
||||
site_obj = Site.objects.update_or_create(defaults=site, url=site.get('url'))
|
||||
for site_rules in data:
|
||||
if site_rules.get('pk'):
|
||||
del site_rules['pk']
|
||||
site_obj = Site.objects.update_or_create(defaults=site_rules, url=site_rules.get('url'))
|
||||
print(site_obj)
|
||||
xpath_update.append(site_obj[0].name + (' 规则新增成功!' if site_obj[1] else '更新成功!'))
|
||||
xpath_update.append(site_obj[0].name + (' 规则新增成功!' if site_obj[1] else '规则更新成功!'))
|
||||
return JsonResponse(data=CommonResponse.success(
|
||||
msg='更新成功!!',
|
||||
data={
|
||||
|
||||
84
pt.json
84
pt.json
@@ -2504,10 +2504,10 @@
|
||||
"pk": 35,
|
||||
"fields": {
|
||||
"created_at": "2022-07-23T19:10:24.853",
|
||||
"updated_at": "2022-08-28T20:13:23.847",
|
||||
"updated_at": "2022-09-01T08:40:02.389",
|
||||
"url": "https://club.hares.top/",
|
||||
"name": "白兔hares",
|
||||
"logo": "favicon.ico",
|
||||
"logo": "http://favicon.ico",
|
||||
"sign_in_support": true,
|
||||
"get_torrent_support": true,
|
||||
"get_userinfo_support": true,
|
||||
@@ -2554,22 +2554,22 @@
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[5]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//li/i[@title=\"邀请\"]/following-sibling::span/text()",
|
||||
"time_join_rule": "//td[contains(text(),\"加入\")]/following-sibling::td[1]//span/@title",
|
||||
"invitation_rule": "//div[@class=\"layui-tab-item layui-show\"]//table[1]/tr[3]/td[4]/a/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": "//li/i[@title=\"上传量\"]/following-sibling::span/text()",
|
||||
"downloaded_rule": "//li/i[@title=\"下载量\"]/following-sibling::span/text()",
|
||||
"ratio_rule": "//li/i[@title=\"分享率\"]/following-sibling::span/text()",
|
||||
"my_sp_rule": "//li/i[@title=\"奶糖\"]/following-sibling::span/a/text()",
|
||||
"hour_sp_rule": "//div[contains(text(),\"每小时能获取\")]/text()[1]",
|
||||
"my_bonus_rule": "//li/i[@title=\"做种积分\"]/following-sibling::span/a/text()",
|
||||
"my_level_rule": "//li/i[@title=\"等级\"]/following-sibling::span/text()",
|
||||
"my_hr_rule": "//table/tr[114]/td[2]/text()/text()",
|
||||
"leech_rule": "//li/i[@title=\"下载中\"]/following-sibling::span/text()",
|
||||
"seed_rule": "//li/i[@title=\"做种中\"]/following-sibling::span/text()",
|
||||
"uploaded_rule": "//table[2]/tr[2]/td[4]/text()",
|
||||
"downloaded_rule": "//table[2]/tr[2]/td[6]/text()",
|
||||
"ratio_rule": "//table[2]/tr[2]/td[2]/text()",
|
||||
"my_sp_rule": "//table/tr[2]/td[8]/text()",
|
||||
"hour_sp_rule": "//div[contains(text(),\"每小时\")]/text()[1]",
|
||||
"my_bonus_rule": "//div[@class=\"layui-tab-item layui-show\"]//table[1]/tr[4]/td[2]/text()[1]",
|
||||
"my_level_rule": "//ul/li[2]/span/text()",
|
||||
"my_hr_rule": "//table/tr[14]/td[2]/text()/text()",
|
||||
"leech_rule": "//ul/li/i[@title=\"下载中\"]/following-sibling::span[@class=\"list-info\"]/text()",
|
||||
"seed_rule": "//img[@class=\"arrowup\"][1]/following-sibling::text()[1]",
|
||||
"record_count_rule": "/html/body/b/text()",
|
||||
"seed_vol_rule": "//div[@id=\"ka1\"]//tr/td[3]",
|
||||
"mailbox_rule": "//a[@href=\"messages.php\"]/text()[1]",
|
||||
"seed_vol_rule": "//tr/td[3]",
|
||||
"mailbox_rule": "//a[@href=\"messages.php\"]/font/text()",
|
||||
"hash_rule": "//tr[13]/td[2]/table/tbody/tr/td[1]/text()"
|
||||
}
|
||||
},
|
||||
@@ -2578,10 +2578,10 @@
|
||||
"pk": 36,
|
||||
"fields": {
|
||||
"created_at": "2022-07-27T12:59:12.234",
|
||||
"updated_at": "2022-08-28T20:13:23.849",
|
||||
"updated_at": "2022-09-01T08:43:54.589",
|
||||
"url": "https://www.nicept.net/",
|
||||
"name": "老师",
|
||||
"logo": "favicon.ico",
|
||||
"logo": "http://favicon.ico",
|
||||
"sign_in_support": true,
|
||||
"get_torrent_support": true,
|
||||
"get_userinfo_support": true,
|
||||
@@ -2628,16 +2628,16 @@
|
||||
"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]",
|
||||
"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]",
|
||||
"downloaded_rule": "//font[@class=\"color_downloaded\"]/following-sibling::text()[1]",
|
||||
"ratio_rule": "//font[@class=\"color_ratio\"][1]/following-sibling::text()[1]",
|
||||
"my_sp_rule": "//a[@href=\"mybonus.php\"]/following-sibling::text()[1]",
|
||||
"invitation_rule": "//td[@class=\"embedded\"]/table/tr[2]/td[2]/a/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": "//tr[7]/td[2]/table/tr[2]/td[1]/text()",
|
||||
"downloaded_rule": "//tr[7]/td[2]/table/tr[2]/td[2]/text()",
|
||||
"ratio_rule": "//tr[7]/td[2]/table/tr[1]/td[1]/font/text()",
|
||||
"my_sp_rule": "//td[@class=\"embedded\"]/table/tr[13]/td[2]/text()",
|
||||
"hour_sp_rule": "//div[contains(text(),\"每小时\")]/text()[1]",
|
||||
"my_bonus_rule": "//font[@class=\"color_bonus\" and contains(text(),\"积分\")]/following-sibling::text()[1]",
|
||||
"my_level_rule": "//span[@class=\"medium\"]/span[@class=\"nowrap\"][1]/a[contains(@class,\"_Name\")]/@class",
|
||||
"my_bonus_rule": "//td[@class=\"embedded\"]/table/tr[14]/td[2]/text()",
|
||||
"my_level_rule": "//tr/td/span/span/a/@class",
|
||||
"my_hr_rule": "//*[@id=\"outer\"]/table/tbody/tr/td/table/tbody/tr[14]/td[2]/text()",
|
||||
"leech_rule": "//img[@class=\"arrowdown\"][1]/following-sibling::text()[1]",
|
||||
"seed_rule": "//img[@class=\"arrowup\"][1]/following-sibling::text()[1]",
|
||||
@@ -2652,10 +2652,10 @@
|
||||
"pk": 37,
|
||||
"fields": {
|
||||
"created_at": "2022-07-27T13:01:11.697",
|
||||
"updated_at": "2022-08-28T20:13:23.851",
|
||||
"updated_at": "2022-09-01T08:50:58.853",
|
||||
"url": "http://avgv.cc/",
|
||||
"name": "艾薇",
|
||||
"logo": "favicon.ico",
|
||||
"logo": "http://favicon.ico",
|
||||
"sign_in_support": false,
|
||||
"get_torrent_support": true,
|
||||
"get_userinfo_support": true,
|
||||
@@ -2702,17 +2702,17 @@
|
||||
"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()",
|
||||
"time_join_rule": "//table/tr[3]/td[2]/span/@title",
|
||||
"latest_active_rule": "//table/tr[4]/td[2]/span/@title",
|
||||
"uploaded_rule": "//tr[7]/td[2]/table/tr[2]/td[1]/text()",
|
||||
"downloaded_rule": "//tr[7]/td[2]//table/tr[2]/td[2]/text()",
|
||||
"ratio_rule": "//tr[7]/td[2]/table/tr/td[1]/font/text()",
|
||||
"my_sp_rule": "//tr[13]/td[2]/text()",
|
||||
"hour_sp_rule": "//div[contains(text(),\"每小时\")]/text()[1]",
|
||||
"my_bonus_rule": "//tr[113]/td[2]/text()",
|
||||
"my_level_rule": "//tr/td/span/span/a/@class",
|
||||
"my_hr_rule": "//table/tr[14]/td[2]/text()",
|
||||
"invitation_rule": "//a[contains(@href,\"invite.php?id=\")]/following-sibling::text()[1]",
|
||||
"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]",
|
||||
"downloaded_rule": "//font[@class=\"color_downloaded\"]/following-sibling::text()[1]",
|
||||
"ratio_rule": "//font[@class=\"color_ratio\"][1]/following-sibling::text()[1]",
|
||||
"my_sp_rule": "//a[@href=\"mybonus.php\"]/following-sibling::text()[1]",
|
||||
"hour_sp_rule": "//div[contains(text(),\"每小时能获取\")]/text()[1]",
|
||||
"my_bonus_rule": "//font[@class=\"color_bonus\" and contains(text(),\"积分\")]/following-sibling::text()[1]",
|
||||
"my_level_rule": "//span[@class=\"medium\"]/span[@class=\"nowrap\"][1]/a[contains(@class,\"_Name\")]/@class",
|
||||
"my_hr_rule": "//a[@href=\"myhr.php\"]/text()",
|
||||
"leech_rule": "//img[@class=\"arrowdown\"][1]/following-sibling::text()[1]",
|
||||
"seed_rule": "//img[@class=\"arrowup\"][1]/following-sibling::text()[1]",
|
||||
"record_count_rule": "/html/body/b/text()",
|
||||
@@ -3318,7 +3318,7 @@
|
||||
"pk": 46,
|
||||
"fields": {
|
||||
"created_at": "2022-08-26T20:53:50.259",
|
||||
"updated_at": "2022-08-28T20:13:23.870",
|
||||
"updated_at": "2022-08-31T13:36:12.867",
|
||||
"url": "https://totheglory.im/",
|
||||
"name": "TTG",
|
||||
"logo": "http://favicon.ico",
|
||||
@@ -3341,7 +3341,7 @@
|
||||
"page_viewpeerlist": "viewpeerlist.php?id={}",
|
||||
"sign_in_method": "post",
|
||||
"sign_in_captcha": false,
|
||||
"sign_in_params": "{signed_timestamp: time.time(), signed_token: \"ebc43a16088dd4ac555521cdfbea0855\"}",
|
||||
"sign_in_params": "{}",
|
||||
"sign_in_headers": "{}",
|
||||
"hr": false,
|
||||
"hr_rate": 2,
|
||||
|
||||
Reference in New Issue
Block a user