Skip to main content

Ultra-fast Telegram bot framework with YouTube downloader, currency, Wikipedia PDF and QR code generation

Reason this release was yanked:

I have paste a new version.

Project description

โšก Zentel Pro 1.0.1

Ultra-fast async Telegram bot framework โ€” YouTube yuklovchi, valyuta konvertor, Wikipediaโ†’PDF va QR kod generatori bilan.

pip install zentel-pro

๐Ÿš€ Tez boshlash

from zentel_pro import ZentelBot, VideoDownloader, CurrencyConverter, WikiToPDF, QRGenerator, Filter

bot = ZentelBot("YOUR_BOT_TOKEN")
dl = VideoDownloader()
currency = CurrencyConverter()
wiki = WikiToPDF(language="uz")
qr = QRGenerator()

# โ”€โ”€โ”€ /start โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("start", aliases=["help"])
async def start(ctx):
    await ctx.reply(
        "๐Ÿ‘‹ Salom! <b>Zentel Pro Bot</b>\n\n"
        "๐Ÿ“น /video [URL] โ€” video yuklab berish\n"
        "๐ŸŽต /audio [URL] โ€” mp3 yuklab berish\n"
        "๐Ÿ’ฑ /convert 100 USD UZS โ€” valyuta\n"
        "๐Ÿ“– /wiki [mavzu] โ€” Wikipedia PDF\n"
        "๐Ÿ”ฒ /qr [matn/URL] โ€” QR kod\n"
        "๐Ÿ“ถ /wifi [ssid] [parol] โ€” WiFi QR"
    )

# โ”€โ”€โ”€ Video yuklovchi โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("video")
async def video_cmd(ctx):
    url = ctx.args[0] if ctx.args else VideoDownloader.extract_url(ctx.text)
    if not url:
        await ctx.reply("โŒ URL yuboring!\nMisol: /video https://youtube.com/watch?v=...")
        return

    await ctx.upload_video()
    try:
        info = await dl.get_info(url)
        await ctx.reply(f"โณ Yuklanmoqda...\n\n{info}")
        path = await dl.download(url, quality="720p")
        await ctx.send_video(path, caption=f"๐ŸŽฌ {info.title}")
        dl.cleanup(path)
    except Exception as e:
        await ctx.reply(f"โŒ Xato: {e}")

# โ”€โ”€โ”€ Audio (MP3) yuklovchi โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("audio")
async def audio_cmd(ctx):
    url = ctx.args[0] if ctx.args else None
    if not url:
        await ctx.reply("โŒ URL yuboring!")
        return
    await ctx.typing()
    path = await dl.download(url, audio_only=True)
    await ctx.send_document(path, caption="๐ŸŽต MP3 tayyor!")
    dl.cleanup(path)

# โ”€โ”€โ”€ Valyuta konvertatsiya โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("convert")
async def convert_cmd(ctx):
    # /convert 100 USD UZS
    parsed = CurrencyConverter.parse_convert_command(ctx.text)
    if not parsed:
        await ctx.reply("โŒ Foydalanish: /convert 100 USD UZS")
        return
    amount, from_c, to_c = parsed
    await ctx.typing()
    try:
        result = await currency.convert(amount, from_c, to_c)
        await ctx.reply(str(result))
    except Exception as e:
        await ctx.reply(f"โŒ {e}")

@bot.command("kurs")
async def rates_cmd(ctx):
    base = ctx.args[0].upper() if ctx.args else "USD"
    await ctx.typing()
    rates = await currency.get_popular_rates(base)
    await ctx.reply(currency.format_rates(rates, base))

# โ”€โ”€โ”€ Wikipedia โ†’ PDF โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("wiki")
async def wiki_cmd(ctx):
    if not ctx.args:
        await ctx.reply("๐Ÿ“– Foydalanish: /wiki Python\n(yoki /wiki Amir Temur)")
        return
    query = " ".join(ctx.args)
    await ctx.typing()
    result = await wiki.search(query)
    if not result:
        await ctx.reply(f"โŒ '{query}' bo'yicha hech narsa topilmadi.")
        return
    await ctx.reply(result.preview())
    await ctx.upload_document()
    pdf_path = await wiki.to_pdf(result)
    await ctx.send_document(pdf_path, caption=f"๐Ÿ“„ {result.title}")
    wiki.cleanup(pdf_path)

# โ”€โ”€โ”€ QR Kod โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("qr")
async def qr_cmd(ctx):
    if not ctx.args:
        await ctx.reply("๐Ÿ”ฒ Foydalanish: /qr https://google.com\nYoki: /qr Salom Dunyo!")
        return
    data = " ".join(ctx.args)
    await ctx.typing()
    path = await qr.generate(
        data,
        style="rounded",
        color="#1a237e",
        size=500,
    )
    await ctx.send_photo(path, caption=f"โœ… QR kod tayyor!\n\n<code>{data[:80]}</code>")
    qr.cleanup(path)

# โ”€โ”€โ”€ WiFi QR โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.command("wifi")
async def wifi_cmd(ctx):
    args = ctx.args
    if len(args) < 2:
        await ctx.reply("๐Ÿ“ถ Foydalanish: /wifi [SSID] [Parol] [WPA|WEP|nopass]")
        return
    ssid = args[0]
    password = args[1]
    security = args[2] if len(args) > 2 else "WPA"
    await ctx.typing()
    path = await qr.wifi(ssid=ssid, password=password, security=security)
    await ctx.send_photo(path, caption=f"๐Ÿ“ถ WiFi: <b>{ssid}</b>")
    qr.cleanup(path)

# โ”€โ”€โ”€ URL yuborilsa avtomatik video yukla โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.message(Filter.AND(Filter.is_url, Filter.NOT(Filter.text_startswith("/"))))
async def auto_video(ctx):
    url = ctx.text.strip()
    if VideoDownloader.is_supported(url):
        await ctx.reply(
            "๐Ÿ”— Link topildi! Yuklab beraymi?",
            keyboard=bot.inline_keyboard([
                [
                    {"text": "๐Ÿ“น Video (720p)", "callback_data": f"dl_video_720p:{url[:100]}"},
                    {"text": "๐ŸŽต MP3", "callback_data": f"dl_audio:{url[:100]}"},
                ]
            ])
        )

# โ”€โ”€โ”€ Callback handlers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@bot.on("callback_query")
async def handle_callbacks(ctx):
    await ctx.answer()
    if ctx.data.startswith("dl_video_"):
        await ctx.reply("โณ Video yuklanmoqda... iltimos kuting.")
    elif ctx.data.startswith("dl_audio:"):
        await ctx.reply("โณ Audio yuklanmoqda... iltimos kuting.")

# โ”€โ”€โ”€ Run โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
if __name__ == "__main__":
    bot.run()

๐Ÿ“ฆ O'rnatish

pip install zentel-pro

Barcha imkoniyatlar bilan:

pip install zentel-pro[all]

๐Ÿงฉ Modullar

Modul Tavsif
ZentelBot Asosiy bot engine (async polling)
VideoDownloader YouTube, TikTok, Instagram, Twitter va 1000+ saytdan video
CurrencyConverter Real-vaqt valyuta kurslari
WikiToPDF Wikipedia qidiruv va PDF generator
QRGenerator Chiroyli QR kod generatori
Router Handler guruhlovchi
Filter Xabar filtrlari
Context Handler kontekst obyekti

โšก Nima uchun Zentel Pro tez?

  • httpx async HTTP โ€” bir vaqtda yuzlab so'rov
  • asyncio.Semaphore โ€” parallel xabar ishlash
  • Keepalive connections โ€” TCP qayta ulanish xarajatisiz
  • Smart caching โ€” valyuta kurslari 5 daqiqa keshlanadi
  • Executor โ€” og'ir operatsiyalar thread poolda

๐Ÿ“‹ Talablar

  • Python 3.9+
  • httpx โ€” async HTTP
  • yt-dlp โ€” video yuklovchi
  • reportlab โ€” PDF generator
  • qrcode[pil] โ€” QR kod
  • Pillow โ€” rasm ishlash

๐Ÿ“„ Litsenziya

MIT License โ€” bepul foydalaning, o'zgartiring, tarqating!


Zentel Pro 1.0.1 โ€” Made with โค๏ธ for Uzbek developers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zentel_pro-1.0.1.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zentel_pro-1.0.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file zentel_pro-1.0.1.tar.gz.

File metadata

  • Download URL: zentel_pro-1.0.1.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zentel_pro-1.0.1.tar.gz
Algorithm Hash digest
SHA256 aba04305bccc1e71db11c38c4ea9f4e8b36c1a45bb93524ea26931ea6ee68d1a
MD5 2064d7a441abc9e76e941cbf0097e7d9
BLAKE2b-256 ecdfaed1f8dc7cd8dc5e299180975a2fec33cd77044de13c87bdaa01c42ae494

See more details on using hashes here.

File details

Details for the file zentel_pro-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: zentel_pro-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for zentel_pro-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b021ab73f8af4ba6e642da094f018a3108fb0212781d5d37013f6e7f0725503b
MD5 d43f500e96ff585e359b07a7cb49df00
BLAKE2b-256 2fbdce85ba754436b655f9b9104cb08fd1b898b3a28b233c6b6e1ec2736d129c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page