Now onto the next, probably big, question -
Me and a lot of my coworkers work remotely even before the pandemic. What do I need to do to make an AMI available for all of them, who don’t necessarily have shotgun_api3 and flask installed, and probably don’t want to bother downloading my script? Will it ever be as simple as one click for the user?
The answer might be crystal clear to some. I’m late to the game
Like, what exactly do I put into the “URL” field of my AMI, to make it send proper info to my localhost? Right now I have “http://localhost:5000” there. Not sure how to proceed…
(edit after an hour: I think it’s the POST request that I’m supposed to parse, not the URL? Then I’m stuck again not knowing what the POST request looks like.)
I’m pretty familiar with the Python API, so the “juicy part” of the script that actually does the job (e.g. download and package files) doesn’t intimidate me as much.
If someone could kindly explain or point me to helpful resources, I’d be very very happy!
The answer to what puzzled me for hours turned out to a very simple fact - the URL isn’t the only thing that’s sent from Shotgun to my server / local machine! Apparently the selected entity’s ID, the project’s ID, etc. are all sent in the body of the HTTP message.
There seems to be a small lag between when you update the URL of your AMI and when that new URL really kicks in.
What happened to me was that after getting to hello world with http://127.0.0.1:5000/, I changed it http://127.0.0.1:5000/playlist-download/, and then freaked out for a good half an hour because that “playlist-download” part wouldn’t show up in my HTTP message…
To echo @mmoshev 's reply - custom protocol handler seems very tempting at this moment, now that I’ve had some success with the HTTP route.
I’m on a Mac and will try out registering the custom protocol.
My big question from the original post still stands - how do I make an AMI so that someone can use it without having to install a bunch of Python packages?
Maybe there are great examples out there and I just need to Google… I’ll surely share my findings if any.