'Find and get last link animation attachement mov in python

i’m trying to ‘save to’ a specific link in shotgun (the last animation mov founded linked in shotgun of chosen shots)

the final adress i’d like to save is: 15.22.180.80/file_serve/attachement/9430064/ALCM_552-001_025_Anim_001_003.mov

first i don’t know how to find the last animation link (the second link in page 2)

also, as you can see the adress of the mov is a bit strange for me as i doesn’t know how i can guess this part: 9430064 (last link in page 3)

i’d tryed many way to do that without any succes at all, i understand python but not shotgun, so any help or idea is welcome

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source