Update NSLGameScanner.py

This commit is contained in:
Roy 2024-12-13 11:11:38 -08:00 committed by GitHub
parent c92defb786
commit 95132cf63b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,24 +307,6 @@ def download_artwork(game_id, art_type, shortcut_id, dimensions=None):
download_artwork(game_id, 'icons', shortcut_id) download_artwork(game_id, 'icons', shortcut_id)
if data is None:
print(f"No data available for {game_id}. Skipping download.")
return
for artwork in data['data']:
image_url = artwork['thumb']
print(f"Downloading image from: {image_url}")
try:
response = requests.get(image_url, stream=True)
response.raise_for_status()
if response.status_code == 200:
with open(file_path, 'wb') as file:
file.write(response.content)
return b64encode(response.content).decode('utf-8')
except requests.exceptions.RequestException as e:
print(f"Error downloading image: {e}")
if art_type == 'icons':
download_artwork(game_id, 'icons_ico', shortcut_id)
def get_game_id(game_name): def get_game_id(game_name):