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 HTTPyt-dlpโ video yuklovchireportlabโ PDF generatorqrcode[pil]โ QR kodPillowโ rasm ishlash
๐ Litsenziya
MIT License โ bepul foydalaning, o'zgartiring, tarqating!
Zentel Pro 1.0.1 โ Made with โค๏ธ for Uzbek developers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aba04305bccc1e71db11c38c4ea9f4e8b36c1a45bb93524ea26931ea6ee68d1a
|
|
| MD5 |
2064d7a441abc9e76e941cbf0097e7d9
|
|
| BLAKE2b-256 |
ecdfaed1f8dc7cd8dc5e299180975a2fec33cd77044de13c87bdaa01c42ae494
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b021ab73f8af4ba6e642da094f018a3108fb0212781d5d37013f6e7f0725503b
|
|
| MD5 |
d43f500e96ff585e359b07a7cb49df00
|
|
| BLAKE2b-256 |
2fbdce85ba754436b655f9b9104cb08fd1b898b3a28b233c6b6e1ec2736d129c
|