Skip to content

Commit

Permalink
raise_for_status instead of custom error message
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi authored and devxpy committed Jul 30, 2024
1 parent 0da6b33 commit ba3faf7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions retro/sadtalker.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def fixed_generate_blink_seq_randomly(num_frames):
def urlretrieve(url, filename):
"""Same as urllib.urlretrieve but uses requests because urllib breaks on discord attachments. Does not support data: URLs and local files."""
res = requests.get(url)
if not res.ok:
raise ValueError(
f"Could not access user provided url: {url} ({res.status_code} {res.reason}"
)
res.raise_for_status()
with open(filename, "wb") as f:
f.write(res.content)
return filename, None
Expand Down

0 comments on commit ba3faf7

Please sign in to comment.