Build a Telegram Bot and Channel Autoposter for Adult Videos with a Free API
Telegram is one of the few big platforms where adult channels and bots are allowed to exist, and for many adult sites it has become a traffic source that doesn't depend on search engines. We run Telegram channels for our own sites, posting new videos every day. This guide shows how to build the two things most webmasters want: a bot that answers commands like /random and /search blonde, and a channel autoposter that publishes a few videos a day without repeating itself. Both use the free Pornalizer Porn API, so you don't host or scrape anything.
Before you start: Telegram's rules
- Adult content is allowed in channels and bots, but Telegram's iOS and Android apps hide "sensitive content" unless the user enables it in settings. Tell your audience that, and link the setting in your channel description.
- Post links and thumbnails, not uploaded video files. It keeps your bot small, and links bring visitors to your site, which is the point.
- Send thumbnails as spoilers (blurred until tapped). Public adult channels mostly get banned after user reports of explicit images, and a blurred preview with a title and link draws far fewer reports. The examples below set
has_spoiler. - Nothing involving minors, non-consent or real people without consent, ever. The API only returns videos that pass a content safety filter, but your own captions must follow the same rule.
1. Create the bot
- Open
@BotFatherin Telegram, send/newbot, pick a name and a username ending in "bot". - Copy the token it gives you. Treat it like a password.
- For the autoposter, create a channel and add the bot as an administrator with permission to post.
2. The bot: /random and /search
This version needs only Python 3 and requests. It uses long polling, so it runs anywhere without a web server.
import os, time, html, requests
TOKEN = os.environ["BOT_TOKEN"]
TG = f"https://api.telegram.org/bot{TOKEN}"
API = "https://pornalizer.app/api/v1"
SITE = "https://your-site.com" # where your video pages live
def card(v):
tags = " ".join("#" + t.replace(" ", "").replace("(", "").replace(")", "") for t in v["tags"][:4])
return (f"<b>{html.escape(v['title'])}</b>\n"
f"⏱ {v['duration']} {tags}\n"
f"<a href=\"{SITE}/video/{v['id']}/\">▶ Watch the full video</a>")
def send(chat, v):
requests.post(f"{TG}/sendPhoto", data={
"chat_id": chat, "photo": v["thumbnail"], "caption": card(v), "parse_mode": "HTML", "has_spoiler": "true"})
def handle(msg):
chat, text = msg["chat"]["id"], msg.get("text", "")
if text.startswith("/random"):
r = requests.get(f"{API}/videos/random", params={"count": 1}).json()
elif text.startswith("/search"):
q = text.partition(" ")[2].strip() or "popular"
r = requests.get(f"{API}/search", params={"query": q, "per_page": 3, "sort": "popular"}).json()
else:
requests.post(f"{TG}/sendMessage", data={"chat_id": chat,
"text": "Try /random or /search blonde"})
return
for v in r.get("results", [])[:3]:
send(chat, v)
if __name__ == "__main__": # so the autoposter below can import card()
offset = 0
while True:
upd = requests.get(f"{TG}/getUpdates", params={"offset": offset, "timeout": 50}, timeout=60).json()
for u in upd.get("result", []):
offset = u["update_id"] + 1
if "message" in u:
handle(u["message"])
Run it with BOT_TOKEN=123:abc python3 bot.py. To keep it running, use a systemd service or any process manager.
Ideas to extend it: /trans, /gay or niche commands using the orientation and tags filters; /performer name using /performers/{slug}; inline buttons with "Another one".
3. The channel autoposter
A channel lives or dies by consistency: a few good posts every day beat fifty in one go. This script posts the newest videos that match your niche and remembers what it already posted.
import json, os, pathlib, requests
from bot import card, TG # reuse card() from the bot above
CHANNEL = "@your_channel"
SEEN = pathlib.Path("posted.json")
seen = set(json.loads(SEEN.read_text())) if SEEN.exists() else set()
r = requests.get("https://pornalizer.app/api/v1/search", params={
"orientation": "trans", "sort": "newest", "per_page": 30, "min_duration": 300}).json()
new = [v for v in r["results"] if v["id"] not in seen][:3]
for v in new:
requests.post(f"{TG}/sendPhoto", data={"chat_id": CHANNEL, "photo": v["thumbnail"],
"caption": card(v), "parse_mode": "HTML", "has_spoiler": "true"})
seen.add(v["id"])
SEEN.write_text(json.dumps(sorted(seen)))
Schedule it two or three times a day with cron. Change the filters to your niche: tags, categories, studios, performers or query. Use sort=popular or /videos/trending for a "best of the week" post.
What we learned running channels
- The link should go to your site, not straight to a player. Your page has your ads, your related videos and your brand; that's where the value is.
- Cards beat bare links. A thumbnail, a clean title, the duration and three or four tags get far more clicks than a URL.
- Mix in reasons to stay: once in a while, post a pinned message with your other channels, your subreddit and your site. People who arrive from one channel often follow the rest.
- Don't flood. Two to five posts a day, at the same times, keep subscribers; twenty a day make them mute or leave.
- Brand every caption with your site name. People who remember it search for it later, and brand searches are often the first search traffic a new site gets.
Keeping it working
Because the API only returns health-checked videos and its embeds switch to a backup copy when a file dies, the links you post keep working. If you also store videos on your own site, check /videos/removed daily and unpublish what it lists; our post on content syndication explains why that sync matters.
Full reference: API documentation. Running WordPress? The integrations page lists ready-made options.
Frequently asked questions
Are adult bots allowed on Telegram?
Adult content is allowed in Telegram channels and bots, but Telegram's mobile apps hide sensitive content until users enable it in settings. Content involving minors or non-consent is banned everywhere.
Do I need a server to run a Telegram bot?
Any machine that stays online works. The example uses long polling, so it needs no web server or public IP; a small VPS or a home server is enough.
Where does the bot get its videos?
From the free Pornalizer Porn API, which returns titles, thumbnails, tags and permanent embed players. The bot posts thumbnails and links; it never uploads video files.
Want a WordPress tube site that fills itself with tagged, categorized video — free?
Get your API key →