Fix PeeringDB auth header and info_type

This commit is contained in:
2026-01-15 01:27:03 +01:00
parent 5870ab952f
commit 45fd4454fa

View File

@@ -5,7 +5,7 @@ OUT_DIR = os.getenv("OUT_DIR", "/data")
LICENSE_KEY = os.getenv("MAXMIND_LICENSE_KEY", "").strip() LICENSE_KEY = os.getenv("MAXMIND_LICENSE_KEY", "").strip()
PDB_API_KEY = os.getenv("PDB_API_KEY", "").strip() PDB_API_KEY = os.getenv("PDB_API_KEY", "").strip()
PDB_BASE = os.getenv("PDB_BASE", "https://www.peeringdb.com") PDB_BASE = os.getenv("PDB_BASE", "https://www.peeringdb.com")
INFO_TYPE = os.getenv("PDB_INFO_TYPE", "Research and Education") INFO_TYPE = os.getenv("PDB_INFO_TYPE", "Educational/Research")
TIMEOUT = int(os.getenv("HTTP_TIMEOUT", "30")) TIMEOUT = int(os.getenv("HTTP_TIMEOUT", "30"))
LIMIT = int(os.getenv("PDB_LIMIT", "250")) LIMIT = int(os.getenv("PDB_LIMIT", "250"))
@@ -49,7 +49,7 @@ def pdb_headers():
if not PDB_API_KEY: if not PDB_API_KEY:
return {"Accept": "application/json"} return {"Accept": "application/json"}
# PeeringDB API Key (optional) # PeeringDB API Key (optional)
return {"Accept": "application/json", "Authorization": f"api-key {PDB_API_KEY}"} return {"Accept": "application/json", "Authorization": f"Api-Key {PDB_API_KEY}"}
def fetch_pdb_page(skip: int): def fetch_pdb_page(skip: int):
url = f"{PDB_BASE}/api/net" url = f"{PDB_BASE}/api/net"
@@ -105,4 +105,3 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()