From 2e63061e6a6df9f7b397859e0200dc2bfda1a245 Mon Sep 17 00:00:00 2001 From: icebreak <59821932+ACE-830@users.noreply.github.com> Date: Fri, 10 May 2024 23:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DFileList=E5=81=9A=E7=A7=8D?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E5=81=9A=E7=A7=8D=E4=BD=93=E7=A7=AF=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了FileList站点的做种数大于50时,做种数和做种体积统计错误的bug,优化了分享率的读取方法 --- plugins/sitestatistic/siteuserinfo/file_list.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/sitestatistic/siteuserinfo/file_list.py b/plugins/sitestatistic/siteuserinfo/file_list.py index 611a4dd..3fa75e9 100644 --- a/plugins/sitestatistic/siteuserinfo/file_list.py +++ b/plugins/sitestatistic/siteuserinfo/file_list.py @@ -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) # 是否存在下页数据