(从中文译出)
Hey, I ve got a problem. I have an html file hosted on github pages who looks like this: (It can be accessed at this site)
<head>
<meta http-equiv="refresh" content="0; url=https://gi-b716.github.io/modrinth-api-tools/api/files/1.2.0.zip">
</head>
Ideally, it should redirect to this 1.2.0.zip after accessing the above html file, and when I accessed it using Google Chrome, it did work that way. However, I wanted to get this file in Python, so I wrote this code:
download_url = https://gi-b716.github.io/modrinth-api-tools/api/version/d/lasted
r = requests.get(download_url, allow_redirects=True)
with open("1.2.0.zip", "wb") as f:
f.write(r.content)
f.close()
但是,我总是能够拿到档案,尽管请求发现的是转头。 我找不到有关返回时档案的任何信息。
What can I do to capture the correct file?