From 7bb3cac7fbab8e370287483d6213873566d99038 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 12 Feb 2022 12:41:29 +0100 Subject: [PATCH] Avoid problems with percent encoded utf-8 abstracts on certain chinese papers --- cps/metadata_provider/scholar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/metadata_provider/scholar.py b/cps/metadata_provider/scholar.py index f94a65f47..b0c10b665 100644 --- a/cps/metadata_provider/scholar.py +++ b/cps/metadata_provider/scholar.py @@ -17,7 +17,7 @@ # along with this program. If not, see . import itertools from typing import Dict, List, Optional -from urllib.parse import quote +from urllib.parse import quote, unquote try: from fake_useragent.errors import FakeUserAgentError @@ -66,7 +66,7 @@ class scholar(Metadata): ) match.cover = result.get("image", {}).get("original_url", generic_cover) - match.description = result["bib"].get("abstract", "") + match.description = unquote(result["bib"].get("abstract", "")) match.publisher = result["bib"].get("venue", "") match.publishedDate = result["bib"].get("pub_year") + "-01-01" match.identifiers = {"scholar": match.id}