Advertisement
here2share

# pinterest_bulkdown.py

Apr 21st, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. # pinterest_bulkdown.py
  2. import re, urllib
  3. try:
  4.     import urllib.request # this is if you are running on Python 3
  5. except:
  6.     pass
  7.  
  8. sites='''
  9. https://www.pinterest.com/pin/123456789012345678/
  10. https://www.pinterest.com/pin/999999999999999999/...
  11. '''
  12.  
  13. sites=sites.strip().splitlines()
  14. for s in sites:
  15.     try: u = urllib.urlopen(s)
  16.     except:
  17.         try: u = urllib.request.urlopen(s)
  18.         except: pass
  19.     if u:
  20.         text = u.read()
  21.         for z in ['media-cache-ak0.pinimg.com/assets/js/warm','media-cache-ak0.pinimg.com/600x315','media-cache-ak0.pinimg.com/736x']:
  22.             text=text.replace(z,'')
  23.         while 1:
  24.             try: text=text[text.index('media-cache')-16:]
  25.             except:
  26.                 print '!!!'
  27.                 break
  28.             if '.com/originals' in text[:60]:
  29.                 text=text[text.index('"')+1:]
  30.                 text=text[:text.index('"')]
  31.                 print text
  32.                 break
  33.     else:
  34.         print '!!!!!!!!!' # not connected?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement