# - requests (python-requests.org)
import requests
import sys
import json
import urllib
import random
server = "odo-bucket.omegle.com"
debug_log = open("debug.log","a") # Set to FALSE to disable excessive messages
config = {'verbose': open("/dev/null","w")}
headers = {}
headers['Referer'] = 'http://odo-bucket.omegle.com/'
headers['Connection'] = 'keep-alive'
headers['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Ubuntu/11.10 Chromium/15.0.874.106 Chrome/15.0.874.106 Safari/535.2'
headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
headers['Accept'] = 'application/json'
headers['Accept-Encoding'] = 'gzip,deflate,sdch'
headers['Accept-Language'] = 'en-US'
headers['Accept-Charset'] = 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
if debug_log:
config['verbose'] = debug_log
def debug(msg):
if debug_log:
print "DEBUG: " + str(msg)
debug_log.write(str(msg) + "\n")
def getcookies():
r = requests.get("http://" + server + "/",config=config)
debug(r.cookies)
return r.cookies
def start():
r = requests.request("POST", "http://" + server + "/start?rcs=1&spid=", data="rcs=1&spid=", config=config, headers=headers)
omegle_id = r.content.strip("\"")
debug("Got ID: " + str(omegle_id))
cookies = getcookies()
event(omegle_id, cookies)
def send(omegle_id, cookies, msg):
r = requests.request("POST","http://" + server + "/send", data="msg=" + urllib.quote_plus(msg) + "&id=" + omegle_id, config=config, headers=headers, cookies=cookies)
if r.content == "win":
print "You: " + msg
else:
print "Error sending message, check the log"
debug(r.content)
def event(omegle_id, cookies):
captcha = False
r = requests.request("POST","http://" + server + "/events",data="id=" + omegle_id, cookies=cookies, config=config, headers=headers)
try:
parsed = json.loads(r.content)
for e in parsed:
if e[0] == "waiting":
print "Waiting for a connection..."
elif e[0] == "count":
print "There are " + str(e[1]) + " people connected to Omegle"
elif e[0] == "connected":
print "Connection established!"
send(omegle_id, cookies, "dicks")
elif e[0] == "typing":
print "Stranger is typing..."
elif e[0] == "stoppedTyping":
print "Stranger stopped typing"
elif e[0] == "gotMessage":
print "Stranger: " + e[1]
try:
send(omegle_id, cookies, "What do you mean?")
except:
debug("Send errors!")
elif e[0] == "strangerDisconnected":
print "Stranger Disconnected"
elif e[0] == "suggestSpyee":
print "Omegle thinks you should be a spy. Fuck omegle."
elif e[0] == "recaptchaRequired":
print "Omegle think's you're a bot (now where would it get a silly idea like that?). Fuckin omegle. Recaptcha code: " + e[1]
captcha = True
else:
print "Some shit is fucked up. Stay tuned for debugging information:"
print json.dumps(parsed)
except:
print "Derka derka derka"
print "Reconnecting..."
start()
elif not captcha:
event(omegle_id, cookies)
start()
{"text":"text","html5":"html","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"lua","bash":"sh","erlang":"erlang","go":"golang","c":"c_cpp","cpp":"c_cpp","diff":"diff","latex":"latex","sql":"sql","xml":"xml","0":"text","abap":"abap","actionscript":"actionscript","actionscript3":"actionscript","ada":"ada","apache":"apache_conf","applescript":"applescript","asm":"assembly_x86","autohotkey":"autohotkey","closure":"closure","cobol":"cobol","coffeescript":"coffee","cpp-winapi":"c_cpp","c_loadrunner":"c_cpp","c_mac":"c_cpp","c_winapi":"c_cpp","csharp":"csharp","d":"d","dart":"dart","dot":"dot","eiffel":"eiffel","fortran":"fortran","groovy":"groovy","haskell":"haskell","haxe":"haxe","ini":"ini","io":"io","java":"java","java5":"java","make":"makefile","matlab":"matlab","mysql":"mysql","objc":"objectivec","ocaml":"ocaml","pascal":"pascal","perl":"perl","perl6":"perl","postgresql":"pgsql","powershell":"powershell","prolog":"prolog","properties":"properties","rails":"ruby","rust":"rust","scala":"scala","scheme":"scheme","smarty":"smarty","tcl":"tcl","vala":"vala","vb":"vbscript","verilog":"verilog","vhdl":"vhdl","yaml":"yaml"}