Skip to content

Commit

Permalink
change filename length limit for truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
modhurita committed Nov 6, 2023
1 parent 96b39e9 commit ba85b9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions artscraper/googleart.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ def paint_dir(self):

# Set maximum length for the part of the directory name derived from the
# Google Arts & Culture url for the artwork
max_byte_length = 100
max_byte_length = 240
hash_length = 40
if byte_length >= max_byte_length:
truncated_byte_string = paint_id_encoded[:max_byte_length]
truncated_byte_string = paint_id_encoded[:max_byte_length-hash_length]
# Decode back to string, handling possible incomplete character at the end
while True:
try:
Expand Down

0 comments on commit ba85b9b

Please sign in to comment.