Forráskód Böngészése

fix download urls

Johannes Gütschow 5 hónapja
szülő
commit
b55d94b6fc

+ 2 - 0
src/unfccc_ghg_data/unfccc_downloader/fetch_submissions_btr.py

@@ -79,6 +79,8 @@ if __name__ == "__main__":
                 title = link.contents[0]
             if href.startswith("/documents"):
                 href = "https://unfccc.int" + href
+            elif href.startswith("documents"):
+                href = "https://unfccc.int/" + href
             # Only add pages in the format https://unfccc.int/documents/65587
             # to further downloads
             if str(Path(href).parent).endswith("documents"):

+ 3 - 1
src/unfccc_ghg_data/unfccc_downloader/fetch_submissions_nc.py

@@ -54,13 +54,15 @@ if __name__ == "__main__":
         if "href" not in link.attrs:
             continue
         href = link.attrs["href"]
-        if "/documents/" in href:
+        if "documents/" in href:
             if "title" in link.attrs.keys():
                 title = link.attrs["title"]
             else:
                 title = link.contents[0]
             if href.startswith("/documents"):
                 href = "https://unfccc.int" + href
+            elif href.startswith("documents"):
+                href = "https://unfccc.int/" + href
             # Only add pages in the format https://unfccc.int/documents/65587
             # to further downloads
             if str(Path(href).parent).endswith("documents"):