⚝
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 :
~
/
home
/
python
/
View File Name :
getredis.py
from binance.um_futures import UMFutures import time import argparse import pymysql import redis import json parser = argparse.ArgumentParser() parser.add_argument("-symbol", help="Sembol Giriniz") args = parser.parse_args() symbol = args.symbol r = redis.Redis() def get_price_by_symbol(symbol): price_data = r.hget("symbols", symbol) if price_data: # JSON formatındaki veriyi Python dictionary'sine dönüştürün price_data_dict = eval(price_data) # Price değerini alın price = price_data_dict.get("price", 0) return float(price) else: return None price = get_price_by_symbol(symbol) if price is not None: print(f"{symbol} sembolüne ait Price değeri: {price}") else: print(f"{symbol} sembolü bulunamadı.")