⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
home
/
python
/
View File Name :
mysocket.py
import pymysql import redis import asyncio from binance import AsyncClient, BinanceSocketManager async def mysocket(): client = await AsyncClient.create() bm = BinanceSocketManager(client) # start any sockets here, i.e a trade socket while True: ts = bm.symbol_ticker_socket('BNBBTC') print(ts) await client.close_connection() try: baglanti = pymysql.connect( host='127.0.0.1', db='coinbot', user='root', password='Ua04420076*', port=3306, charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor ) r=redis.Redis() with baglanti.cursor() as islem: islem.execute('SELECT * from `settings` where `id`=1') ayar=islem.fetchone() baglanti.commit() r.mset({"binanceuser":ayar['binanceapikey'],"binancesecret":ayar['binancesecretkey']}) loop = asyncio.get_event_loop() loop.run_until_complete(mysocket()) finally: # Veritabanı bağlantısını kapat if 'baglanti' in locals(): baglanti.close()