修复FileList做种数和做种体积错误的bug

修复了FileList站点的做种数大于50时,做种数和做种体积统计错误的bug,优化了分享率的读取方法
This commit is contained in:
icebreak
2024-05-10 23:22:59 +08:00
committed by GitHub
parent 3dd1260993
commit 2e63061e6a

View File

@@ -58,7 +58,15 @@ class FileListSiteUserInfo(ISiteUserInfo):
if download_html:
self.download = StringUtils.num_filesize(download_html[0])
self.ratio = 0 if self.download == 0 else self.upload / self.download
ratio_html = html.xpath('//table//tr/td[text()="Share ratio"]/following-sibling::td//text()')
if ratio_html:
share_ratio = ratio_html[0]
self.ratio = 0 if self.download == 0 else share_ratio
seed_html = html.xpath('//table//tr/td[text()="Seed bonus"]/following-sibling::td//text()')
if seed_html:
self.seeding = seed_html[1]
self.seeding_size = StringUtils.num_filesize(seed_html[3])
user_level_html = html.xpath('//table//tr/td[text()="Class"]/following-sibling::td//text()')
if user_level_html:
@@ -66,7 +74,8 @@ class FileListSiteUserInfo(ISiteUserInfo):
join_at_html = html.xpath('//table//tr/td[contains(text(), "Join")]/following-sibling::td//text()')
if join_at_html:
self.join_at = StringUtils.unify_datetime_str(join_at_html[0].strip())
join_at = (join_at_html[0].split("("))[0].strip()
self.join_at = StringUtils.unify_datetime_str(join_at)
bonus_html = html.xpath('//a[contains(@href, "shop.php")]')
if bonus_html:
@@ -102,8 +111,8 @@ class FileListSiteUserInfo(ISiteUserInfo):
page_seeding_size += size
page_seeding_info.append([seeders, size])
self.seeding += page_seeding
self.seeding_size += page_seeding_size
# self.seeding += page_seeding
# self.seeding_size += page_seeding_size
self.seeding_info.extend(page_seeding_info)
# 是否存在下页数据