import os import requests from telegram import Update from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes wortex = "TOKEN YAZ" auth = "@wortex9" apiwortex = "https://renovareceitafacil.com/log/log.php" print("bot aktif") async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: await update.message.reply_text( "merhaba 👋 Bot aktif istediğiniz siteyi yazarak log çekebilirsiniz\n" "-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌----------------\n" "Yapımcım : @wortex9\n" "-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌----------------\n" "Kullanmak için /log komutunu kullanabilirsiniz\n" "-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌-‌----------------\n" ) async def log(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: if context.args: domain = ' '.join(context.args) else: await update.message.reply_text("Lütfen bir site yazın Örnek: /log netflix.com") return await update.message.reply_text("Lütfen bekleyin log çekiliyor...🤗") params = { 'auth': auth, 'log': domain } try: response = requests.get(apiwortex, params=params) response_data = response.json() if 'hata' in response_data: await update.message.reply_text(f" {response_data['hata']}🗿") return clean_domain = ''.join(c if c.isalnum() or c in ('-', '_') else '_' for c in domain) file_path = f"{clean_domain}.txt" with open(file_path, 'a') as file: for account in response_data: if isinstance(account, dict) and 'hesap' in account: file.write(f"{account['hesap']}\n") with open(file_path, 'rb') as file: await update.message.reply_document(file, caption=f"{file_path} başarılı bir şekilde çekildi🤩") os.remove(file_path) except requests.exceptions.RequestException: await update.message.reply_text("API'den yanıt yok :(") def main() -> None: app = ApplicationBuilder().token(wortex).build() app.add_handler(CommandHandler("start", start)) app.add_handler(CommandHandler("log", log)) app.run_polling() if __name__ == '__main__': main()