Coder Social home page Coder Social logo

teletok's Introduction

TeleTok

TeleTok: Telegram bot for TikTok

Description

This bot will send you a video from a TikTok. Pretty simple.

Just share a link to the chat (no need to mention the bot)

Thanks to

Built on top of aiogram

Installation

Env

(REQUIRED)

  • API_TOKEN - Bot token from BotFather

(OPTIONAL)

  • ALLOWED_IDS - JSON int list. Gives access only to specific user/chat id (default: [] (empty list) = all users/chats)
  • REPLY_TO_MESSAGE - JSON Boolean. Whether the bot should reply to source message or not (default: true)
  • WITH_CAPTIONS - JSON Boolean. Whether the bot should include captions from TikTok in its message (default: true)

Local

$ python3 -m venv venv
$ (venv) pip install -r requirements.txt
$ (venv) echo "API_TOKEN=foo:bar" >> .env
$ (venv) export $(cat .env)
$ (venv) python app

Docker

$ docker build -t teletok .
$ docker run -e "API_TOKEN=foo:bar" teletok

Docker Compose

$ echo "API_TOKEN=foo:bar" >> .env
$ docker compose up -d --build

License

MIT

teletok's People

Contributors

arslan-charyyev avatar captaincolonelfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

teletok's Issues

Option for him to respond in channels and respond to bots in a group or channel

I have an RSS FEED feed bot that sends me links to tiktok videos. But it doesn't respond to messages from another bot, so I always have to manually forward the link for it to download, and I also wanted the option for it to work in channels because it would be great if it had that option.
One more thing, could he send the video link and the title in the video caption?.

I know it's asking a lot and I know how difficult it is to make these changes. Thank you very much in advance.
And thank you very much for the bot it helped me a lot, it was the best I found on github

Не работает на VPS и Heroku

Привет. Попробовал установить на VPS, бот отправил одно видео и отключился, ругается на таймаут. Пробовал прописывать user_agent, также ничего не изменилось. Попробовал на Heroku поставить, ноль реакции. За день до этого сдох другой бот для тиктока (также с гитхаба), также перестал присылать видео и в принципе отвечать. Делает это с очень большими задержками. Пинг до api.telegram.org большой. Либо я с кривыми руками, либо что-то где-то сломалось. Стоит отдельный бот для ютуба, он всё исправно присылает.
image

TikTok(?) update now redirects video pages

Hello, as with some update, TikTok seems to redirect the TeleTok user agent/cookies.

When running TeleTok with env var HTTPX_LOG_LEVEL=debug, with let's say video url: https://vm.tiktok.com/ZMRJq1M2c/ I get logs like:

DEBUG [2021-12-14 22:36:06] httpx._client - HTTP Request: GET https://vm.tiktok.com/ZMRJq1M2c/ "HTTP/1.1 301 Moved Permanently"
<a href="https://m.tiktok.com/v/6991506151049317634.html?_d=.......LONGHTMLDIDNTPASTEITALL">Moved Permanently</a>.

TeleTok is not able to process these videos. I could not get around this change, would've submitted a PR otherwise.. Hope you can fix it!

vid always empty in TikTokAPI.download_video

Hello, some update to tiktok page code has broken the downloader.

I guess you are aware of that already though :-)

The problematic line is line 51 in api/tiktok.py:

for vid, link in re.findall(self.regexp_key, page.text):

where vid is empty for some reason and the downloader cannot download the media.

Lack of user filtering

Can you please add a setting: "Only process messages from specific user by User_ID"?

I use the bot exclusively for myself and do not let other users waste my traffic and power on processing their requests.

P.S. it would be cool after adding this function, add such a parameter to run the docker image

Bot stops to send a video

For a while my copy of the bot was working flawlessly.
About 2 weeks ago the bot stops repsponding and sending video back.
I tried to made a repo fork again but it doesn't helped.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.