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 }} +
+
+