diff --git a/grab-artist.py b/grab-artist.py index 576ea2a..f19ff73 100644 --- a/grab-artist.py +++ b/grab-artist.py @@ -67,11 +67,11 @@ try: # For each asset in the project (might be multiple images) for asset in assets: asset_type = asset["asset_type"] + asset_position = asset["position"] # If the asset is an image if asset_type == "image": asset_image_url = asset["image_url"] - asset_position = asset["position"] # Generate a download filename filename = artist_directory + slugify(project_name[:60] + "_" + project_hash_id + "_" + str(asset_position)) + "." + extensionFromUrl(asset_image_url) diff --git a/util.py b/util.py index 456fc8c..5139906 100644 --- a/util.py +++ b/util.py @@ -4,6 +4,7 @@ import time from pathlib import Path import re import os +import codecs import urllib.request from headers import * @@ -47,7 +48,7 @@ def logMsg(msg, mode, artist_name): print(col + f"[{timestamp}][{artist_name}]: " + msg) # Log to logfile - logfile = open("./logs/" + slugify(artist_name) + ".txt", "a") # Open existing or create + logfile = codecs.open("./logs/" + slugify(artist_name) + ".txt", "a", 'u8') # Open existing or create logfile.write(prefix + " " + "[" + timestamp + "]: " + msg + "\n") logfile.close()