(url: str)
| 167 | |
| 168 | |
| 169 | def fetch_xml(url: str) -> str: |
| 170 | req = Request( |
| 171 | url, |
| 172 | headers={ |
| 173 | "User-Agent": "cn1-website-generator/1.0", |
| 174 | "Accept": "application/xml,text/xml,*/*", |
| 175 | }, |
| 176 | ) |
| 177 | with urlopen(req, timeout=20) as resp: # nosec B310 - fixed trusted URL |
| 178 | return resp.read().decode("utf-8", errors="replace") |
| 179 | |
| 180 | |
| 181 | def write_data(libs: List[Dict[str, str]], status: str, error: str = "") -> None: |