-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChat.py
More file actions
31 lines (31 loc) · 1.07 KB
/
Copy pathChat.py
File metadata and controls
31 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import json
import requests
import time
class sendnow():
def __init__(self):
data=json.loads(open("key.json").read())
self.server=data["server"]
self.headers={
"Origin": "https://www.omegle.com",
"Referer": "https://www.omegle.com/",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"
}
self.url="https://{}.omegle.com/send".format(self.server)
self.data={}
self.data["id"]=data["id"]
def send(self,message):
if message=="exit":
self.url="https://{}.omegle.com/disconnect".format(self.server)
r=requests.post(self.url,headers=self.headers,data=self.data)
if r.text == "win":
print("[{}] Disconnect".format(time.strftime("%d-%b %I:%M:%S %p")))
else:
self.data["msg"]=message
r=requests.post(self.url,headers=self.headers,data=self.data)
if r.text == "win":
print("[{}]Sended: {}".format(time.strftime("%d-%b %I:%M:%S %p"),message))
if __name__ == '__main__':
while True:
mes=input("Type: ")
app=sendnow()
app.send(message=mes)