Skip to content

Commit a73638e

Browse files
committed
Fix httpx usage
Follow redirects when downloading from GitHub via httpx. Fixes issue #686 [1]. [1]: #686 Reported-by: Antonio Petricca <[email protected]>
1 parent a0cbfaa commit a73638e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spleeter/model/provider/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def checksum(self, name: str) -> str:
114114
self.CHECKSUM_INDEX,
115115
)
116116
)
117-
response: httpx.Response = httpx.get(url)
117+
response: httpx.Response = httpx.get(url, follow_redirects=True)
118118
response.raise_for_status()
119119
index: Dict = response.json()
120120
if name not in index:
@@ -137,7 +137,7 @@ def download(self, name: str, path: str) -> None:
137137
url = f"{url}.tar.gz"
138138
logger.info(f"Downloading model archive {url}")
139139
with httpx.Client(http2=True) as client:
140-
with client.stream("GET", url) as response:
140+
with client.stream("GET", url, follow_redirects=True) as response:
141141
response.raise_for_status()
142142
archive = NamedTemporaryFile(delete=False)
143143
try:

0 commit comments

Comments
 (0)