mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-15 18:45:15 +00:00
Alters get_description code for inventaire queries
This commit is contained in:
parent
3916666897
commit
609b7f58c8
1 changed files with 3 additions and 2 deletions
|
@ -222,9 +222,10 @@ class Connector(AbstractConnector):
|
||||||
def get_description(self, links: JsonDict) -> str:
|
def get_description(self, links: JsonDict) -> str:
|
||||||
"""grab an extracted excerpt from wikipedia"""
|
"""grab an extracted excerpt from wikipedia"""
|
||||||
link = links.get("enwiki")
|
link = links.get("enwiki")
|
||||||
if not link:
|
if not link or not link.get("title"):
|
||||||
return ""
|
return ""
|
||||||
url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={link}"
|
title = link.get("title")
|
||||||
|
url = f"{self.base_url}/api/data?action=wp-extract&lang=en&title={title}"
|
||||||
try:
|
try:
|
||||||
data = get_data(url)
|
data = get_data(url)
|
||||||
except ConnectorException:
|
except ConnectorException:
|
||||||
|
|
Loading…
Reference in a new issue