feat: 需要保存openalex pdferror
This commit is contained in:
parent
3c568c076b
commit
b300c1779b
|
|
@ -153,7 +153,7 @@ def get_pdf_from_openalex(number_of_task: int =10):
|
|||
return "stoped"
|
||||
count = 0
|
||||
qs = Paper.objects.filter(is_oa=True, has_fulltext=False).exclude(
|
||||
fetch_status="downloading")[:number_of_task]
|
||||
fetch_status="downloading").exclude(fail_reason__contains="openalex_pdf_not_found")[:number_of_task]
|
||||
if not qs.exists():
|
||||
return "done"
|
||||
for paper in qs:
|
||||
|
|
@ -462,6 +462,9 @@ def save_pdf_from_openalex(paper:Paper):
|
|||
elif res.status_code == 404:
|
||||
paper.save_fail_reason("openalex_pdf_not_found")
|
||||
return "openalex_pdf_error: 404"
|
||||
else:
|
||||
paper.save_fail_reason("openalex_pdf_error")
|
||||
return f"openalex_pdf_error: {res.status_code} {res.text}"
|
||||
|
||||
|
||||
def save_pdf_from_elsevier(paper:Paper):
|
||||
|
|
|
|||
Loading…
Reference in New Issue