feature: download also other pages

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:04:13 +02:00
committed by Tim Grelka
parent 80b184c678
commit 64bf2cb0c4
3 changed files with 43 additions and 2 deletions
+15 -1
View File
@@ -138,4 +138,18 @@ class Download:
for snippet in tqdm(self.content_api.get("items/snippet"), desc="Downloading snippets"):
snippets[snippet["ident"]] = snippet["content"]
with open("data/snippets.json", "w", encoding="utf-8") as file:
json.dump(snippets, file, ensure_ascii=False, indent=4)
json.dump(snippets, file, ensure_ascii=False, indent=4)
def download_content(self):
contents = []
for content in self.content_api.get("items/content"): #tqdm(self.content_api.get("items/content"), desc="Downloading content"):
contents.append(
{
"url_part": content["url_part"],
"content": content["content"],
"sidebar": content["sidebar"],
}
)
with open("data/content.json", "w", encoding="utf-8") as file:
json.dump(contents, file, ensure_ascii=False, indent=4)