summarylogtreecommitdiffstats
path: root/github-pr-808-rebased-2.3.0.patch
blob: 219b4691e9380f552f875846ff4b07577bf69cd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From d9eb568ce7abd079ea4459431328e9f87fd7e1cc Mon Sep 17 00:00:00 2001
From: Claudia Pellegrino <claui@users.noreply.github.com>
Date: Fri, 2 Dec 2022 10:23:26 +0100
Subject: [PATCH] Fix httpx usage

Follow redirects when downloading from GitHub via httpx.
Fixes issue #686 [1].

[1]: https://github.com/deezer/spleeter/issues/686

Reported-by: Antonio Petricca <antonio.petricca@gmail.com>
---
 spleeter/model/provider/github.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/spleeter/model/provider/github.py b/spleeter/model/provider/github.py
index 3a9b190..c020555 100644
--- a/spleeter/model/provider/github.py
+++ b/spleeter/model/provider/github.py
@@ -114,7 +114,7 @@ class GithubModelProvider(ModelProvider):
                 self.CHECKSUM_INDEX,
             )
         )
-        response: httpx.Response = httpx.get(url)
+        response: httpx.Response = httpx.get(url, follow_redirects=True)
         response.raise_for_status()
         index: Dict = response.json()
         if name not in index:
@@ -137,7 +137,7 @@ class GithubModelProvider(ModelProvider):
         url = f"{url}.tar.gz"
         logger.info(f"Downloading model archive {url}")
         with httpx.Client(http2=True) as client:
-            with client.stream("GET", url) as response:
+            with client.stream("GET", url, follow_redirects=True) as response:
                 response.raise_for_status()
                 archive = NamedTemporaryFile(delete=False)
                 try:
-- 
2.38.1