Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,13 @@ def download_file(url: str, output_path: Path):
|
|
12 |
print(f"Skipping {output_path.name}, already exists.")
|
13 |
return
|
14 |
print(f"Downloading {url}")
|
15 |
-
|
|
|
16 |
response.raise_for_status()
|
17 |
output_path.write_bytes(response.content)
|
18 |
print(f"Saved to {output_path}")
|
19 |
|
|
|
20 |
# Download files
|
21 |
download_file("https://raw.githubusercontent.com/BradyStephenson/bible-data/refs/heads/main/BibleData-Person.csv", Path("BibleData-Person.csv"))
|
22 |
download_file("https://www.ssa.gov/oact/babynames/names.zip", Path("names.zip"))
|
|
|
12 |
print(f"Skipping {output_path.name}, already exists.")
|
13 |
return
|
14 |
print(f"Downloading {url}")
|
15 |
+
headers = {"User-Agent": "Mozilla/5.0"} # Bypass basic bot protections
|
16 |
+
response = requests.get(url, headers=headers)
|
17 |
response.raise_for_status()
|
18 |
output_path.write_bytes(response.content)
|
19 |
print(f"Saved to {output_path}")
|
20 |
|
21 |
+
|
22 |
# Download files
|
23 |
download_file("https://raw.githubusercontent.com/BradyStephenson/bible-data/refs/heads/main/BibleData-Person.csv", Path("BibleData-Person.csv"))
|
24 |
download_file("https://www.ssa.gov/oact/babynames/names.zip", Path("names.zip"))
|