Skip to content

Commit

Permalink
Fix azure
Browse files Browse the repository at this point in the history
Microsoft is blocking the default user-agent for python requests Added one that fixes this issues.
  • Loading branch information
1nd0 authored and 0xdade committed May 10, 2023
1 parent 975b60e commit d672d2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sephiroth/providers/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d672d2a

Please sign in to comment.