From 903ca92463cd3e965c484d72a88a8554007b88bb Mon Sep 17 00:00:00 2001 From: ngfchl Date: Fri, 26 Aug 2022 07:10:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8E=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=B7=B2=E6=AD=A3=E7=A1=AE=E6=98=BE=E7=A4=BA=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E7=9A=84bug=202.=20=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto_pt/views.py | 11 ++++++----- pt_site/UtilityTool.py | 2 +- templates/auto_pt/restart.html | 7 ++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/auto_pt/views.py b/auto_pt/views.py index 860e6e8..7828b23 100644 --- a/auto_pt/views.py +++ b/auto_pt/views.py @@ -3,6 +3,7 @@ import os import subprocess from datetime import datetime +import markdown from django.http import JsonResponse from django.shortcuts import render @@ -126,10 +127,10 @@ def do_update(request): def restart_container(request): - # scraper = pt_spider.get_scraper() - # res = scraper.get('https://gitee.com/ngfchl/ptools/raw/master/update.md') - # update_notes = markdown.markdown(res.text, extensions=['tables']) - # print(update_notes) + scraper = pt_spider.get_scraper() + res = scraper.get('https://gitee.com/ngfchl/ptools/raw/master/update.md') + update_notes = markdown.markdown(res.text, extensions=['tables']) + print(update_notes) return render(request, 'auto_pt/restart.html', - # context={'update_notes': update_notes} + context={'update_notes': update_notes} ) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index e0929e2..2bbdd32 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -770,7 +770,7 @@ class PtSpider: # leech = self.get_user_torrent(leeching_html, site.leech_rule) # seed = self.get_user_torrent(seeding_html, site.seed_rule) leech = ''.join(details_html.xpath(site.leech_rule)).strip() - seed = ''.join(details_html.xpath(site.leech_rule)).strip() + seed = ''.join(details_html.xpath(site.seed_rule)).strip() # seed = len(seed_vol_list) ratio = ''.join(details_html.xpath(site.ratio_rule)).replace(',', '').strip(']:').strip() if ratio == '无限' or ratio == '∞' or ratio == '---': diff --git a/templates/auto_pt/restart.html b/templates/auto_pt/restart.html index ad780f2..5fdcd34 100644 --- a/templates/auto_pt/restart.html +++ b/templates/auto_pt/restart.html @@ -18,7 +18,12 @@ - {# {{ update_notes|safe }}#} + +
+ {{ update_notes|safe }} +
+
+