mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-11-20 08:09:18 +01:00
Add files via upload
This commit is contained in:
parent
c14c9c3b61
commit
25b67e2879
@ -164,15 +164,14 @@ def download_artwork(game_id, api_key, art_type, shortcut_id, dimensions=None):
|
||||
response = requests.get(image_url, stream=True)
|
||||
response.raise_for_status()
|
||||
if response.status_code == 200:
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
with open(file_path, 'wb') as file:
|
||||
file.write(response.content)
|
||||
break
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Error downloading image: {e}") # Added print statement
|
||||
print(f"Error downloading image: {e}")
|
||||
if art_type == 'icons':
|
||||
download_artwork(game_id, api_key, 'icons_ico', shortcut_id)
|
||||
if art_type in ['wide_grid', 'big_picture']:
|
||||
download_artwork(game_id, api_key, 'hero', shortcut_id)
|
||||
|
||||
|
||||
def get_game_id(game_name):
|
||||
|
Loading…
Reference in New Issue
Block a user