Skip to content

Commit

Permalink
Update NSLGameScanner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
moraroy authored Dec 13, 2024
1 parent c92defb commit 95132cf
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions NSLGameScanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,24 +307,6 @@ def download_artwork(game_id, art_type, shortcut_id, dimensions=None):
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):
Expand Down

0 comments on commit 95132cf

Please sign in to comment.