Skip to content
Snippets Groups Projects
Commit ea60182e authored by Martin Morgenstern's avatar Martin Morgenstern
Browse files

Url-quote document ids in HTTP requests

parent e68d36ba
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import json
import sys
from pathlib import Path
from urllib.error import HTTPError
from urllib.parse import quote
from urllib.request import Request, urlopen
if not sys.platform.startswith("win"):
......@@ -44,7 +45,7 @@ def main(instance_url, session_id, export_to):
num_ok = num_fail = 0
for row in data["history"]:
document_id = row["id"]
document_url = f"{instance_url}/{document_id}"
document_url = f"{instance_url}/{quote(document_id)}"
try:
contents = slurp(f"{document_url}/download", session_id)
with open(Path(target_dir, f"{document_id}.md"), mode="wb") as stream:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment