Share your repls and programming experiences

← Back to all posts
Tiktok Auto Embed Bot
theohalpern (27)

Discord Bot that downloads and embeds tiktok links sent by users

The TikTok Auto Embed bot will automatically embed the tiktoks links you send. This is helpful because your friends can now watch the tiktoks you send without leaving the app. When you post a TikTok link, the TikTok Auto Embed bot will delete your original message and send a new message containing: the original link, the sender's discord tag, and an embedded copy of the video.

Link to install:

The bot is completely async so it can handle many requests at once.

There are 3 parts to the video pipline: First pyppeteer goes to the tiktok link and finds the file link. It also saves the cookies. Next I send a aiohttp request with custom headers and cookies to download the video. Finaly if the tiktok is over 8 mb the code uses asyncio.create_subprocess_exec to run ffmpeg on the file and compress it.

ad on tiktok:

theohalpern (27)

The bot keeps getting rate limited, any suggestions to fix this?

ch1ck3n (2078)

@theohalpern Rate limiting means you can only use this thing for a couple times in a certain timeframe

maybe buy the API if you can buy it?