From d672d2aeb879474f7ab34d18e2e0ba8d1275ab17 Mon Sep 17 00:00:00 2001 From: Michael Hoffman <31942743+1nd0@users.noreply.github.com> Date: Wed, 10 May 2023 16:01:11 -0700 Subject: [PATCH] Fix azure Microsoft is blocking the default user-agent for python requests Added one that fixes this issues. --- sephiroth/providers/azure.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sephiroth/providers/azure.py b/sephiroth/providers/azure.py index 88ba9a8..cf951ee 100644 --- a/sephiroth/providers/azure.py +++ b/sephiroth/providers/azure.py @@ -14,7 +14,10 @@ def _get_ranges(self): azure_download_page = ( "https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519" ) - r = requests.get(azure_download_page) + headers = { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0' + } + r = requests.get(azure_download_page, headers = headers) soup = BeautifulSoup(r.content, "html.parser") direct_link = soup.select_one(".failoverLink")["href"] r = requests.get(direct_link)