Skip to main content

Generate direct download links for Telegram media using Pyrogram

Project description

PyroLinks

A simple Pyrogram-based module to create streaming download links for Telegram files !

pip install pyrolinks

🍺Example

from pyrogram import Client, filters
from pyrogram.types import Message
from pyrolinks.client import PyroLinks, compose
from pyrolinks.errors import PyroLinksError

app = Client(
    "pyrolinks",
    api_id=123456,
    api_hash="abcd",
    token="123:abc",
)

links = PyroLinks(
    app,
    schema="http",
    domain="example.com",
    ip="0.0.0.0",
    port=8080,
    route="/dl",
    logger=logging.getLogger("PyroLinks"),
)
@app.on_message(filters.private & (filters.document | filters.video | filters.audio | filters.photo))
async def handler(client, message: Message):
    try:
        link = await links.generate_link(message)
        await message.reply(f"✅ Direct link:\n{link}")
    except PyroLinksError as e:
        await message.reply(f"❌ Error: {e}")
compose([links])

Project details


Release history Release notifications | RSS feed

This version

3.1

Download files

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

Source Distribution

pyrolinks-3.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

pyrolinks-3.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

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