Merge pull request #1 from Landius/master
fix: asset_position undefined, logfile encode
This commit is contained in:
commit
0d802da7ad
@ -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)
|
||||
|
3
util.py
3
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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user