Closed
Conversation
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()
|
The following commit authors need to sign the Contributor License Agreement: |
Member
|
This looks like spam. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spam