yaotungyu

sg link to code

May 3rd, 2021
710
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import shotgun
  2. sg = shotgun.connect()
  3.  
  4. links = '''
  5. https://icon.shotgunstudio.com/page/17366#Shot_126813
  6. https://icon.shotgunstudio.com/page/17366#Shot_126643
  7. https://icon.shotgunstudio.com/page/17366#Shot_126642
  8. https://icon.shotgunstudio.com/page/17366#Shot_126731
  9. https://icon.shotgunstudio.com/page/17366#Shot_126793
  10. '''.split('\n')
  11.  
  12. code_list = []
  13. for l in links:
  14.     if 'shotgunstudio' in l:
  15.         #check if # is in:
  16.         if '#Shot' in l:
  17.             ent_id =  l.split('#Shot_')[-1]
  18.             shot_dict = sg.find_one('Shot',[['id','is',int(ent_id)]],['code'])
  19.             code_list.append(shot_dict['code'])
  20. print ','.join(code_list)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×