mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Refactor render function to simplify download URL handling by removing version query parameter
This commit is contained in:
parent
130a429500
commit
3852fda31d
1 changed files with 2 additions and 2 deletions
|
|
@ -42,11 +42,11 @@ def render(filename = "home", download_url: str = GITHUB_URL):
|
|||
latest_version = quote(unquote(request.query_string.decode())) or str(latest_version)
|
||||
if html is None:
|
||||
try:
|
||||
response = requests.get(f"{download_url}{filename}{'?' + latest_version if latest_version and download_url == GITHUB_URL else ''}")
|
||||
response = requests.get(f"{download_url}{filename}")
|
||||
response.raise_for_status()
|
||||
except requests.RequestException:
|
||||
try:
|
||||
response = requests.get(f"{DOWNLOAD_URL}{filename}{'?' + latest_version if latest_version and download_url == GITHUB_URL else ''}")
|
||||
response = requests.get(f"{DOWNLOAD_URL}{filename}")
|
||||
response.raise_for_status()
|
||||
except requests.RequestException:
|
||||
found = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue