Externally linking to thumbnail URL

Is there a way to extract the direct url link to an embedded image?
The link displayed in the thumbnail cell looks something like this:

https://XXXXX.shotgunstudio.com/thumbnail/full/Version/35436?202070

and yet when you click on it, the actual url location is something like this:

https://sg-media-usor-01.s3-accelerate.amazonaws.com/dc4feb37819779f1f12f5f69cce06a8b376fdae2/6fd050214137410fcdaa93a7c09537b0e00e21a4/5161b8306d1f764a_XXXXXXXXXXXXXXXXXXXXX.jpg?response-content-disposition=filename%3D%225161b8306d1f764a_XXXXXXXXXXXXXXXXXXXXX.jpg%22&x-amz-meta-user-id=653&x-amz-meta-user-type=HumanUser&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAYJG6Z4JIQOH3RZHQ%2F20200514%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20200514T151959Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=FwoGZXIvYXdzEEAaDLuIpk7SfNkUEVvPziKvAXAHBW%2BeLluiApQK9YM09M0I94C8wrxNP9XYuvHIdFEBILattUHsotCfA65i7ivyhAzFRZJG7a3796Gv2M3BcJsWlgA2zPOu0nLouxoiFMN%2FkPQ0SbAOacY75v5NNtVTyUV%2Fq9Ko30MhkojWO0vQblfWibnxmU1rsohkt9EftFr17%2F99eqEdS19LKRiRp5fYFlfO0C73cvdyOITVBcENr%2FjcIj6DS2GJniR96%2FrW4SMom7n19QUyLcKHjMIgebHBgE0sRGf7YhS7xAtoHWSfcbsQ5%2F5fiGxuJ7KWWFC%2FGcgR3a8EGg%3D%3D&X-Amz-Signature=28f8f73b34a751b32cc5f97666e7b97811df247d7408773436499f44b915f5bd

I am trying import these images as live-links into another package, and am not able to pull in the images because of the disparity between the url displayed in the cell, and the exact url address where the image is stored.
Is there any way I can have the cell contain the exact link url instead?
Perhaps there is another cell where this is stored?

Thanks

1 Like

Hi @VFX.Soup,

The thumbnail link is s3 link to the thumbnail. When you say link to an embedded image, what is the purpose? Do you want to embed it in another website or another application?

Thanks

Loney

2 Likes

Hi, Loney
That is exactly it, yes.
In this case - I am trying to pull the thumbnail images into cells on a GoogleSheet.
Cheers!

1 Like

I’m looking for the same thing. I need the actual url to the original uploaded thumbnail. Is this possible.

1 Like

Found your solution… Here you go! This method returns both the thumbnail generated by shotgun as well as the original thumbnail.

def getFullRawThumbnail():
    entityType = 'CustomNonProjectEntity08'
    entityID = 423
    filters = [['id', 'is', entityID]]
    fields = ['code', 'image', 'sg_type']
    lowFile = sg.find_one('CustomNonProjectEntity08', filters, fields)
    os.startfile(lowFile['image'])

    # result = sg.download_attachment({'url':'https://***.shotgunstudio.com/thumbnail/full/{}/{}'.format(entityType, entityID)})
    rawFile = sg.get_attachment_download_url({'url':'https://***.shotgunstudio.com/thumbnail/full/{}/{}'.format(entityType, entityID)})
    os.startfile(rawFile)
    print rawFile
2 Likes

Ok - thanks. Was hoping this might be something I could easily pipe into a GoogleSheet without having to resort to Python. Thanks for your help!

2 Likes

@JokerMartini

Apologies for the Noob question, but how would I use the python script you shared to return the AWS URL for a thumbnail? Is there a way to use this script when doing an Excel/CSV export, so it returns both thumbnail URLs in the resulting .csv?

Thanks!