From 76e820468084989d4839630b6f5a1dd5bc75c659 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 10 Feb 2026 12:16:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=AF=E7=94=A8save=5Fpdf=5Ffrom=5Fo?= =?UTF-8?q?penalex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/resm/tasks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/resm/tasks.py b/apps/resm/tasks.py index 3db86b2..8685726 100644 --- a/apps/resm/tasks.py +++ b/apps/resm/tasks.py @@ -360,15 +360,15 @@ def download_pdf(paper_id): else: current_from = "oa_url" msg = save_pdf_from_oa_url(paper) - # if paper.has_fulltext_pdf is False and cache.get("openalex_api_exceed") is None: - # current_from = "openalex" - # msg = save_pdf_from_openalex(paper) if paper.has_fulltext_pdf is False and paper.publication_year <= 2021: current_from = "scihub" msg = save_pdf_from_scihub(paper) - return msg, current_from + if paper.has_fulltext_pdf is False and cache.get("openalex_api_exceed") is None: + current_from = "openalex" + msg = save_pdf_from_openalex(paper) if paper.fail_reason is None and paper.has_fulltext_pdf is False: paper.save_fail_reason(msg) + return msg, current_from finally: paper.fetch_end()