Skip to content

Commit 398730b

Browse files
committed
update to find ID in service.context if id is missing
1 parent aa7c5fd commit 398730b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mapreader/download/iiif_downloader.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ def save_map(
320320
for annot in tqdm(iiif_obj.collect_annotations()):
321321
# Get filename
322322
# host, prefix, identifier
323-
fname = ".".join(annot.id.removeprefix("https://").split("/")[2:])
323+
id = annot.resource["service"]["id"] if annot.id is None else annot.id
324+
fname = ".".join(id.removeprefix("https://").split("/")[2:])
324325

325326
if not os.path.exists(path_save):
326327
os.makedirs(path_save, exist_ok=True)

0 commit comments

Comments
 (0)