diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py old mode 100755 new mode 100644 index 007ee5aa3..0181456f2 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -1318,8 +1318,9 @@ def set_up_auth_cookie(self): def get_attachment_download_url(self, attachment): """Returns the URL for downloading provided Attachment. - :param attachment: (mixed) If type is an int, construct url to download - Attachment with id from Shotgun. + :param attachment: (mixed) If type is a str convert to int. + If type is an int, construct url to download Attachment with id from + Shotgun. If type is a dict, and a url key is present, use that url. If type is a dict, and url key is not present, check if we have an id and type keys and the type is 'Attachment' in which case we @@ -1335,6 +1336,8 @@ def get_attachment_download_url(self, attachment): attachment_id = None if isinstance(attachment, int): attachment_id = attachment + elif isinstance(attachment, str): + attachment_id = int(attachment) elif isinstance(attachment, dict): try: url = attachment['url']