Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- str = "http://i.imgur.com/gallery/29P5XCh"
- id = None
- if 'gallery/' in str:
- id = str[(str.find("gallery/") + len("gallery/")):]
- else:
- id = str[(str.index("imgur.com/") + len("imgur.com/")):]
- if '.' in id:
- id = id[:id.index(".")]
- print(id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement