Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2 as url
- import urllib
- import httplib as http
- import random
- def fmtId( string ):
- return string[1:len( string ) - 1]
- def omegleConnect():
- while True:
- site = url.urlopen('http://omegle.com/start','')
- id = fmtId( site.read() )
- print("#"+id)
- while True:
- site = url.urlopen(req)
- rec = site.read()
- if 'aptcha' in rec:
- print("#CAPTCHA Problem Found please fix it to be able to continue")
- elif 'identDigests' in rec or 'connected' in rec:
- print('#A Stranger Have Connected')
- beginGame(id,req)
- break
- elif 'waiting' in rec:
- print("#Waiting...")
- def player_input(id,req):
- while True:
- site = url.urlopen(req)
- rec = site.read()
- if 'strangerDisconnected' in rec:
- print('#The Stranger Disconnected')
- running = False
- return '',False
- omegleConnect()
- elif 'gotMessage' in rec:
- message = eval(rec)
- try:
- print ">> "+message[0][1]
- message = message[0][1]
- except:
- print'>>ERROR GETTING MESSAGE'
- message = 'error'
- return message,True
- def display(id,req,message):
- typing = url.urlopen('http://omegle.com/typing', '&id='+id)
- typing.close()
- msgReq = url.urlopen('http://omegle.com/send', '&msg='+message+'&id='+id)
- print(message)
- msgReq.close()
- def beginGame(id,req):
- running = True
- display(id,req,'Heyyy')
- display(id,req,'Sub4Sub http://www.youtube.com/user/SnowFlakegoingdeeper ')
- name,running = player_input(id,req)
- if not running:
- omegleConnect()
Advertisement
Add Comment
Please, Sign In to add comment