feat: 先标记为oa_url_need_play
This commit is contained in:
parent
fd16c6f9d2
commit
5dda4efcae
|
|
@ -391,16 +391,17 @@ def save_pdf_from_oa_url(paper:Paper):
|
||||||
paper.save_fail_reason("oa_url_not_pdf")
|
paper.save_fail_reason("oa_url_not_pdf")
|
||||||
return "oa_url_not_pdf"
|
return "oa_url_not_pdf"
|
||||||
elif res.status_code == 403:
|
elif res.status_code == 403:
|
||||||
paper_path = paper.init_paper_path("pdf")
|
paper.save_fail_reason("oa_url_need_play")
|
||||||
is_ok, err_msg = run_async(download_from_url_playwright(paper.oa_url, paper_path))
|
# paper_path = paper.init_paper_path("pdf")
|
||||||
if is_ok:
|
# is_ok, err_msg = run_async(download_from_url_playwright(paper.oa_url, paper_path))
|
||||||
paper.has_fulltext = True
|
# if is_ok:
|
||||||
paper.has_fulltext_pdf = True
|
# paper.has_fulltext = True
|
||||||
paper.save(update_fields=["has_fulltext", "has_fulltext_pdf", "update_time"])
|
# paper.has_fulltext_pdf = True
|
||||||
return "success"
|
# paper.save(update_fields=["has_fulltext", "has_fulltext_pdf", "update_time"])
|
||||||
else:
|
# return "success"
|
||||||
paper.save_fail_reason(f"oa_url_pdf_play_error: {err_msg}")
|
# else:
|
||||||
return f"oa_url_pdf_play_error: {err_msg}"
|
# paper.save_fail_reason(f"oa_url_pdf_play_error: {err_msg}")
|
||||||
|
# return f"oa_url_pdf_play_error: {err_msg}"
|
||||||
return f"oa_url_pdf_oerror: {res.status_code}"
|
return f"oa_url_pdf_oerror: {res.status_code}"
|
||||||
|
|
||||||
def save_pdf_from_openalex(paper:Paper):
|
def save_pdf_from_openalex(paper:Paper):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue