Skip to content

Commit 10b0763

Browse files
authored
Rename index.rst to pip install pyTelegramBotAPI requests
import telebot import requests # Sizning tokeningiz TOKEN = "7992899599:AAEt1pDbuNG-F6f0FBSqTL6I3MrT0U7kWt0" bot = telebot.TeleBot(TOKEN) # Instagram video yuklash uchun funksiyani aniqlaymiz def get_instagram_video_url(url): try: api_url = f"https://savefrom.net/api/convert?url={url}" response = requests.get(api_url) if response.status_code == 200: result = response.json() return result.get("url") # Haqiqiy yuklab olish havolasi except Exception as e: print(f"Xatolik yuz berdi: {e}") return None # Botning /start komandasi uchun xabar @bot.message_handler(commands=['start']) def send_welcome(message): bot.reply_to(message, "Salom! Instagram video havolasini yuboring, men uni yuklab olish uchun havola qaytaraman.") # Instagram havolasini qabul qilish va javob qaytarish @bot.message_handler(func=lambda message: True) def download_instagram_video(message): url = message.text.strip() if "instagram.com" not in url: bot.reply_to(message, "Iltimos, Instagram video havolasini yuboring.") return bot.reply_to(message, "Videoni yuklab olish uchun havola tayyorlanmoqda...") video_url = get_instagram_video_url(url) if video_url: bot.reply_to(message, f"Video tayyor! Yuklab olish uchun havola: {video_url}") else: bot.reply_to(message, "Kechirasiz, videoni yuklab bo'lmadi. Havola to'g'riligini tekshiring.") # Botni ishga tushirish bot.polling()
1 parent 78e7b2a commit 10b0763

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed

documentation/index.rst renamed to documentation/pip install pyTelegramBotAPI requests

File renamed without changes.

0 commit comments

Comments
 (0)