-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfdrs.py
More file actions
25 lines (21 loc) · 873 Bytes
/
Copy pathfdrs.py
File metadata and controls
25 lines (21 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
def download_file(url):
try:
response = requests.get(url)
response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
with open(url.split('/')[-1], 'wb') as f:
f.write(response.content)
print(f"Downloaded {url}")
except requests.HTTPError:
print(f"Failed to download {url}")
def main():
base_url = "https://www.fordservicecontent.com/Ford_Content/IDS/FDRS/"
for major in range(34, 39):
for minor in range(0, 10):
for patch in range(0, 10):
if major == 38 and minor > 5: break
if major == 38 and minor == 5 and patch > 7: break
file_name = f"FDRS_{major}.{minor}.{patch}.exe"
download_file(base_url + file_name)
if __name__ == "__main__":
main()