From 19bc72e19f597e7585ed87d27a5f1cf802bcaca1 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Tue, 20 Sep 2022 13:31:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=8E=A2=E7=B4=A2=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E7=A7=8D=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/admin.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pt_site/admin.py b/pt_site/admin.py index 54b78ae..832b228 100644 --- a/pt_site/admin.py +++ b/pt_site/admin.py @@ -749,7 +749,7 @@ class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAd # 下载种子 # '下载种子', '{}', - obj.site.url + obj.detail_url, + obj.detail_url, obj.title, obj.title[0:20] + ' ...' ) @@ -880,7 +880,7 @@ class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAd username=downloader.username, password=downloader.password, # 仅返回简单JSON - SIMPLE_RESPONSES=True + # SIMPLE_RESPONSES=True ) try: @@ -908,8 +908,8 @@ class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAd ) }) for torrent_info in queryset: - print('创建种子标签', torrent_info.magnet_url) - qb_client.torrents_create_tags(torrent_info.magnet_url) + print('创建种子标签', torrent_info.detail_url) + qb_client.torrents_create_category(torrent_info.detail_url) res = qb_client.torrents.add( # 种子链接 urls=torrent_info.magnet_url, @@ -919,15 +919,17 @@ class TorrentInfoAdmin(ImportExportModelAdmin, AjaxAdmin): # instead of ModelAd # 自动管理种子 use_auto_torrent_management=True, # 任务标签,用于和种子信息关联 - tags=torrent_info.magnet_url, + category=torrent_info.detail_url, # 跳过HASH检查 # is_skip_checking=True ) print(res) if res == 'Ok.': print(torrent_info.magnet_url) - torrent = qb_client.torrents.info(tag=torrent_info.magnet_url) + torrent = qb_client.torrents.info(category=torrent_info.detail_url) print(len(torrent)) + torrent_info.hash_string = torrent[0].hash + torrent_info.save() return JsonResponse(data={ 'status': 'success', 'msg': torrent_info.name + '推送成功!'