Fixed icon error

This commit is contained in:
Roy
2026-03-12 01:26:04 -07:00
committed by GitHub
parent d7cc6cee26
commit f113b0039c
+6 -1
View File
@@ -366,10 +366,15 @@ def download_artwork(game_id, art_type, shortcut_id, dimensions=None):
try:
alt_file_path = file_path.replace('.png', f'.{ext}')
# Use urllib to download the image
with urllib.request.urlopen(image_url) as response:
req = urllib.request.Request(image_url)
req.add_header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64)")
req.add_header("Referer", "https://www.steamgriddb.com/")
with urllib.request.urlopen(req) as response:
if response.status == 200:
image_data = response.read()
# Save the image data to local file
with open(alt_file_path, 'wb') as file:
file.write(image_data)