mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
支持Exoticaz
This commit is contained in:
79
pt.json
79
pt.json
@@ -6319,6 +6319,85 @@
|
||||
"hash_rule": "//td/b[contains(text(),\"Hash\")]/following::text()[1]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "pt_site.site",
|
||||
"pk": 94,
|
||||
"fields": {
|
||||
"created_at": "2022-12-26T10:51:49.583",
|
||||
"updated_at": "2022-12-26T11:36:23.505",
|
||||
"url": "https://exoticaz.to/",
|
||||
"name": "Exoticaz",
|
||||
"logo": "https://exoticaz.to/favicon.ico",
|
||||
"tracker": "tracker.exoticaz.to",
|
||||
"sign_in_support": false,
|
||||
"get_torrent_support": true,
|
||||
"get_userinfo_support": true,
|
||||
"search_support": false,
|
||||
"page_default": "torrents.php",
|
||||
"page_sign_in": "attendance.php",
|
||||
"page_control_panel": "usercp.php",
|
||||
"page_detail": "details.php?id={}",
|
||||
"page_download": "download.php?id={}",
|
||||
"page_user": "profile/{}",
|
||||
"page_search": "torrents.php?search={}",
|
||||
"page_leeching": "getusertorrentlistajax.php?userid={}&type=leeching",
|
||||
"page_uploaded": "getusertorrentlistajax.php?userid={}&type=uploaded",
|
||||
"page_seeding": "profile/{}/active",
|
||||
"page_completed": "getusertorrentlistajax.php?userid={}&type=completed",
|
||||
"page_mybonus": "profile/{}/bonus",
|
||||
"page_viewfilelist": "viewfilelist.php?id={}",
|
||||
"page_viewpeerlist": "viewpeerlist.php?id={}",
|
||||
"sign_in_method": "get",
|
||||
"sign_in_captcha": false,
|
||||
"sign_in_params": "{}",
|
||||
"sign_in_headers": "{}",
|
||||
"hr": false,
|
||||
"hr_rate": 2,
|
||||
"hr_time": 10,
|
||||
"sp_full": 100.0,
|
||||
"limit_speed": 100,
|
||||
"torrents_rule": "//table[@class=\"torrents\"]/tr",
|
||||
"name_rule": ".//td[@class=\"embedded\"]/a/b/text()",
|
||||
"title_rule": ".//a[contains(@href,\"detail\")]/parent::td/text()[last()]",
|
||||
"detail_url_rule": ".//td[@class=\"embedded\"]/a[contains(@href,\"detail\")]/@href",
|
||||
"category_rule": ".//td[@class=\"rowfollow nowrap\"][1]/a[1]/img/@title",
|
||||
"poster_rule": ".//table/tr/td[1]/img/@src",
|
||||
"magnet_url_rule": ".//td/a[contains(@href,\"download.php?id=\")]/@href",
|
||||
"download_url_rule": ".//a[contains(@href,\"download.php?id=\") and contains(@href,\"passkey\")]/@href",
|
||||
"size_rule": ".//td[5]/text()",
|
||||
"hr_rule": ".//table/tr/td/img[@class=\"hitandrun\"]/@title",
|
||||
"sale_rule": ".//img[contains(@class,\"free\")]/@alt",
|
||||
"sale_expire_rule": ".//img[contains(@class,\"free\")]/following-sibling::font/span/@title",
|
||||
"release_rule": ".//td[4]/span/@title",
|
||||
"seeders_rule": ".//a[contains(@href,\"#seeders\")]/text()",
|
||||
"leechers_rule": ".//a[contains(@href,\"#leechers\")]/text()",
|
||||
"completers_rule": ".//a[contains(@href,\"viewsnatches\")]//text()",
|
||||
"viewfilelist_rule": ".//td/text()",
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[7]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//td[contains(text(),\"Invites\")]/following-sibling::td/text()",
|
||||
"time_join_rule": "//td[contains(text(),\"Joined\")]/following-sibling::td/text()",
|
||||
"latest_active_rule": "//td[contains(text(), \"Last Access\")]/following-sibling::td/text()",
|
||||
"uploaded_rule": "//td[text()=\"Uploaded\"]/following-sibling::td/text()",
|
||||
"downloaded_rule": "//td[text()=\"Downloaded\"]/following-sibling::td/text()",
|
||||
"ratio_rule": "//td[text()=\"Ratio\"]/following-sibling::td/text()",
|
||||
"my_sp_rule": "//a[text()=\"Bonus:\"]/following-sibling::text()",
|
||||
"hour_sp_rule": "//h5/strong/text()",
|
||||
"my_bonus_rule": "//font[@class=\"color_bonus\" and contains(text(),\"积分\")]/following-sibling::text()[1]",
|
||||
"my_level_rule": "//td[text()=\"Rank\"]/following-sibling::td/span/text()",
|
||||
"my_passkey_rule": "//span[@class=\"text-monospace\"]/text()",
|
||||
"my_uid_rule": "//a/span[@class=\"user-group group-member\"]/text()",
|
||||
"my_hr_rule": "//a[@title=\"Hit and Run Torrents\"]/following-sibling::text()",
|
||||
"leech_rule": "//a[text()=\"Leeching:\"]/following-sibling::text()",
|
||||
"seed_rule": "//a[text()=\"Seeding:\"]/following-sibling::text()",
|
||||
"record_count_rule": ".//td[3]/text()",
|
||||
"seed_vol_rule": "//span[@class=\"text-yellow\"]/text()",
|
||||
"mailbox_rule": "//a[@href=\"messages.php\"]/font[contains(text(),\"条\")]/text()[1]",
|
||||
"notice_rule": "//a[@href=\"index.php\"]/font[contains(text(),\"条\")]/text()[1]",
|
||||
"hash_rule": "//td/b[contains(text(),\"Hash\")]/following::text()[1]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "auto_pt.task",
|
||||
"pk": 1,
|
||||
|
||||
@@ -7,7 +7,6 @@ import ssl
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
from _ssl import CERT_NONE
|
||||
from datetime import datetime
|
||||
from urllib.request import urlopen
|
||||
|
||||
@@ -203,7 +202,7 @@ class PtSpider:
|
||||
_RESTRICTED_SERVER_CIPHERS = 'ALL'
|
||||
ssl_context.set_ciphers(_RESTRICTED_SERVER_CIPHERS)
|
||||
ssl_context.check_hostname = False
|
||||
ssl_context.verify_mode = CERT_NONE
|
||||
ssl_context.verify_mode = ssl.CERT_NONE
|
||||
scraper.ssl_context = ssl_context
|
||||
headers = {
|
||||
'User-Agent': my_site.user_agent,
|
||||
@@ -1724,6 +1723,7 @@ class PtSpider:
|
||||
# seed_vol_list = seeding_html.xpath(site.record_bulk_rule)
|
||||
try:
|
||||
seed_vol_list = seeding_html.xpath(site.seed_vol_rule)
|
||||
logger.info('做种数量seeding_vol:{}'.format(seed_vol_list))
|
||||
except:
|
||||
pass
|
||||
if 'lemonhd.org' in site.url:
|
||||
@@ -1755,6 +1755,10 @@ class PtSpider:
|
||||
if 'iptorrents.com' in site.url:
|
||||
vol = ''.join(seed_vol.xpath('.//text()'))
|
||||
vol = ''.join(re.findall(r'\((.*?)\)', vol))
|
||||
if 'exoticaz.to' in site.url:
|
||||
if ''.join(seed_vol) == '\n':
|
||||
continue
|
||||
vol = ''.join(seed_vol).strip()
|
||||
else:
|
||||
vol = ''.join(seed_vol.xpath('.//text()'))
|
||||
|
||||
@@ -1825,6 +1829,10 @@ class PtSpider:
|
||||
elif 'hd-torrents.org' in site.url:
|
||||
time_join = datetime.strptime(''.join(details_html.xpath(site.time_join_rule)), '%d/%m/%Y %H:%M:%S')
|
||||
my_site.time_join = time_join
|
||||
elif 'exoticaz.to' in site.url:
|
||||
time_str = ''.join(details_html.xpath(site.time_join_rule)).split('(')[0].strip()
|
||||
time_join = datetime.strptime(time_str, '%d %b %Y %I:%M %p')
|
||||
my_site.time_join = time_join
|
||||
else:
|
||||
time_join = re.findall(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}', ''.join(
|
||||
details_html.xpath(site.time_join_rule)
|
||||
@@ -1920,6 +1928,7 @@ class PtSpider:
|
||||
replace('inf.', 'inf').replace(
|
||||
'null', 'inf').replace('---', 'inf').replace('-', 'inf').replace('\xa0', '').strip(
|
||||
']:').strip(':').strip()
|
||||
logger.info(f'分享率:{details_html.xpath(site.ratio_rule)}')
|
||||
if not ratio:
|
||||
ratio = ''.join(
|
||||
details_html.xpath('//font[@class="color_ratio"][1]/following-sibling::font[1]/text()[1]'))
|
||||
@@ -2017,7 +2026,11 @@ class PtSpider:
|
||||
"""获取时魔"""
|
||||
site = my_site.site
|
||||
url = site.url + site.page_mybonus
|
||||
if 'monikadesign.uk' in site.url:
|
||||
if site.url in [
|
||||
'https://exoticaz.to/',
|
||||
'https://monikadesign.uk/',
|
||||
'https://cinemaz.to/',
|
||||
]:
|
||||
url = url.format(my_site.user_id)
|
||||
logger.info(f'魔力页面链接:{url}')
|
||||
try:
|
||||
|
||||
@@ -6078,5 +6078,81 @@
|
||||
"my_uid_rule": "//td[1]/a[contains(@href,\"usercp.php?uid=\") and @class=\"nav\"][1]/@href",
|
||||
"page_control_panel": "usercp.php?do=pid_c&action=change&uid={}",
|
||||
"tracker": "hdts-announce.ru"
|
||||
},
|
||||
{
|
||||
"id": 94,
|
||||
"created_at": "2022-12-26 10:51:49.583666",
|
||||
"updated_at": "2022-12-26 11:36:23.505090",
|
||||
"name": "Exoticaz",
|
||||
"url": "https://exoticaz.to/",
|
||||
"logo": "https://exoticaz.to/favicon.ico",
|
||||
"sign_in_support": 0,
|
||||
"get_torrent_support": 1,
|
||||
"get_userinfo_support": 1,
|
||||
"search_support": 0,
|
||||
"page_default": "torrents.php",
|
||||
"page_sign_in": "attendance.php",
|
||||
"page_detail": "details.php?id={}",
|
||||
"page_download": "download.php?id={}",
|
||||
"page_user": "profile/{}",
|
||||
"page_search": "torrents.php?search={}",
|
||||
"page_leeching": "getusertorrentlistajax.php?userid={}&type=leeching",
|
||||
"page_uploaded": "getusertorrentlistajax.php?userid={}&type=uploaded",
|
||||
"page_seeding": "profile/{}/active",
|
||||
"page_completed": "getusertorrentlistajax.php?userid={}&type=completed",
|
||||
"page_mybonus": "profile/{}/bonus",
|
||||
"page_viewfilelist": "viewfilelist.php?id={}",
|
||||
"page_viewpeerlist": "viewpeerlist.php?id={}",
|
||||
"sign_in_method": "get",
|
||||
"sign_in_captcha": 0,
|
||||
"sign_in_params": "{}",
|
||||
"sign_in_headers": "{}",
|
||||
"hr": 0,
|
||||
"hr_rate": 2,
|
||||
"hr_time": 10,
|
||||
"sp_full": 100,
|
||||
"limit_speed": 100,
|
||||
"torrents_rule": "//table[@class=\"torrents\"]/tr",
|
||||
"name_rule": ".//td[@class=\"embedded\"]/a/b/text()",
|
||||
"title_rule": ".//a[contains(@href,\"detail\")]/parent::td/text()[last()]",
|
||||
"detail_url_rule": ".//td[@class=\"embedded\"]/a[contains(@href,\"detail\")]/@href",
|
||||
"category_rule": ".//td[@class=\"rowfollow nowrap\"][1]/a[1]/img/@title",
|
||||
"poster_rule": ".//table/tr/td[1]/img/@src",
|
||||
"magnet_url_rule": ".//td/a[contains(@href,\"download.php?id=\")]/@href",
|
||||
"download_url_rule": ".//a[contains(@href,\"download.php?id=\") and contains(@href,\"passkey\")]/@href",
|
||||
"size_rule": ".//td[5]/text()",
|
||||
"hr_rule": ".//table/tr/td/img[@class=\"hitandrun\"]/@title",
|
||||
"sale_rule": ".//img[contains(@class,\"free\")]/@alt",
|
||||
"sale_expire_rule": ".//img[contains(@class,\"free\")]/following-sibling::font/span/@title",
|
||||
"release_rule": ".//td[4]/span/@title",
|
||||
"seeders_rule": ".//a[contains(@href,\"#seeders\")]/text()",
|
||||
"leechers_rule": ".//a[contains(@href,\"#leechers\")]/text()",
|
||||
"completers_rule": ".//a[contains(@href,\"viewsnatches\")]//text()",
|
||||
"viewfilelist_rule": ".//td/text()",
|
||||
"viewpeerlist_rule": ".//tr/td[9]/nobr/text()",
|
||||
"peer_speed_rule": ".//tr/td[7]/nobr/text()",
|
||||
"remark": "",
|
||||
"invitation_rule": "//td[contains(text(),\"Invites\")]/following-sibling::td/text()",
|
||||
"time_join_rule": "//td[contains(text(),\"Joined\")]/following-sibling::td/text()",
|
||||
"latest_active_rule": "//td[contains(text(), \"Last Access\")]/following-sibling::td/text()",
|
||||
"uploaded_rule": "//td[text()=\"Uploaded\"]/following-sibling::td/text()",
|
||||
"downloaded_rule": "//td[text()=\"Downloaded\"]/following-sibling::td/text()",
|
||||
"ratio_rule": "//td[text()=\"Ratio\"]/following-sibling::td/text()",
|
||||
"my_sp_rule": "//a[text()=\"Bonus:\"]/following-sibling::text()",
|
||||
"hour_sp_rule": "//h5/strong/text()",
|
||||
"my_bonus_rule": "//font[@class=\"color_bonus\" and contains(text(),\"积分\")]/following-sibling::text()[1]",
|
||||
"my_level_rule": "//td[text()=\"Rank\"]/following-sibling::td/span/text()",
|
||||
"my_hr_rule": "//a[@title=\"Hit and Run Torrents\"]/following-sibling::text()",
|
||||
"leech_rule": "//a[text()=\"Leeching:\"]/following-sibling::text()",
|
||||
"seed_rule": "//a[text()=\"Seeding:\"]/following-sibling::text()",
|
||||
"record_count_rule": ".//td[3]/text()",
|
||||
"seed_vol_rule": "//span[@class=\"text-yellow\"]/text()",
|
||||
"mailbox_rule": "//a[@href=\"messages.php\"]/font[contains(text(),\"条\")]/text()[1]",
|
||||
"hash_rule": "//td/b[contains(text(),\"Hash\")]/following::text()[1]",
|
||||
"notice_rule": "//a[@href=\"index.php\"]/font[contains(text(),\"条\")]/text()[1]",
|
||||
"my_passkey_rule": "//span[@class=\"text-monospace\"]/text()",
|
||||
"my_uid_rule": "//a/span[@class=\"user-group group-member\"]/text()",
|
||||
"page_control_panel": "usercp.php",
|
||||
"tracker": "tracker.exoticaz.to"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user