All Projects → khoben → telemirror

khoben / telemirror

Licence: GPL-3.0 license
Telegram forwarder from channels via Telegram Client API (telethon)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to telemirror

TgTwitterStreamer
Continous Integration from Twitter to Telegram.
Stars: ✭ 55 (-16.67%)
Mutual labels:  heroku, telethon
sinatras-skeleton
Basic Sinatra Skeleton MVC CRUD App with Sprockets, Warden, ActiveRecord and PostgresQL
Stars: ✭ 13 (-80.3%)
Mutual labels:  heroku
salesforce-iam-flows
Node.js application that implements some of the most common SAML and OAuth flows in Salesforce.
Stars: ✭ 31 (-53.03%)
Mutual labels:  heroku
Deployment to heroku django
This is just a way of deploying to heroku with a django framework application.I hope i would be of help.
Stars: ✭ 30 (-54.55%)
Mutual labels:  heroku
Fire-X
Powerful Telegram Maintained UserBot in Telethon
Stars: ✭ 22 (-66.67%)
Mutual labels:  telethon
opentele
A Python Telegram API Library for converting between tdata and telethon sessions, with built-in official Telegram APIs.
Stars: ✭ 90 (+36.36%)
Mutual labels:  telethon
django-s3file
A lightweight file upload input for Django and Amazon S3
Stars: ✭ 66 (+0%)
Mutual labels:  heroku
Tasks
Simple tasks & notes manager written in PHP, jQuery and Bootstrap using a custom flat file database.
Stars: ✭ 102 (+54.55%)
Mutual labels:  heroku
Discord-Study-Bot
Discord-Study-Bot is a Study-Time-based leaderboard system in discord servers. This features an Overall leaderboard and leaderboards based on a Daily, Weekly, and Monthly basis.
Stars: ✭ 20 (-69.7%)
Mutual labels:  heroku
heroku-stack-container-repo
After deploying this repo your Heroku app will have stack as container. After that you just have to deploy your own original app.
Stars: ✭ 43 (-34.85%)
Mutual labels:  heroku
yt-heroku-demo
Code and instructions used in my YouTube video on how to deploy Spring Boot applications on Heroku
Stars: ✭ 21 (-68.18%)
Mutual labels:  heroku
htui
Heroku Terminal User Interface
Stars: ✭ 109 (+65.15%)
Mutual labels:  heroku
NadekoBot
This is fork of the original NadekoBot, the general purpose of this fork is to make it work on Heroku cloud. Microsoft Sql Server and PostgreSQL edition.
Stars: ✭ 17 (-74.24%)
Mutual labels:  heroku
laravel5-heroku
Laravel 5 with best practices for deployment on Heroku - created by
Stars: ✭ 18 (-72.73%)
Mutual labels:  heroku
representable
We’re creating maps of communities to fight for fair representation. Add your community to the map today and make your voice heard.
Stars: ✭ 14 (-78.79%)
Mutual labels:  heroku
PortForwarder
A small program to forward TCP traffic with QoS options
Stars: ✭ 30 (-54.55%)
Mutual labels:  forwarder
addmember-telegram
Add member auto to telegram group
Stars: ✭ 170 (+157.58%)
Mutual labels:  telethon
trashed
Trashed is an organizational tool designed to help users keep their communities clean.
Stars: ✭ 13 (-80.3%)
Mutual labels:  heroku
telegram-bot-tutorial
Telegram bot tutorial using python and flask
Stars: ✭ 44 (-33.33%)
Mutual labels:  heroku
pack-images
Recipies for building Heroku's Cloud Native Buildpacks builder images
Stars: ✭ 32 (-51.52%)
Mutual labels:  heroku

Telegram forwarder from channels (make channel mirrors) via Telegram Client API (telethon)

Functionality

  • No need to be added by the channel's admin
  • Listen to update events (new message, message edited, message deleted and etc)
  • Live forwarding and updating messages
  • Flexible mapping of source and target channels/chats (one-to-one, many-to-one, many-to-many)
  • Configurable incoming message filters:

Prepare

  1. It's better not to use your main account. Register a new Telegram account

  2. Create Telegram App

  3. Obtain API_ID and API_HASH

    Telegram API Credentials

  4. Setup Postgres database or use InMemoryDatabase with USE_MEMORY_DB=true parameter in .env file

  5. Fill .env-example with your data and rename it to .env

    .env-example contains the minimum environment configuration to run with an in-memory database.

    SESSION_STRING can be obtained by running login.py locally (on your PC with installed python 3.9+) with putted API_ID and API_HASH before.

    Channels ID can be fetched by using @messageinformationsbot Telegram bot (just send it a message from the desired channel).

    .env overview
    # Telegram app ID
    API_ID=test
    # Telegram app hash
    API_HASH=test
    # Telegram session string (telethon session, see login.py in root directory)
    SESSION_STRING=test
    # Mapping between source and target channels/chats
    # Channel/chat id can be fetched by using @messageinformationsbot telegram bot
    # Channel id should be prefixed with -100
    # [id1, id2, id3:id4] means send messages from id1, id2, id3 to id4
    # id5:id6 means send messages from id5 to id6
    # [id1, id2, id3:id4];[id5:id6] semicolon means AND
    CHAT_MAPPING=[-100999999,-100999999,-100999999:-1009999999];
    # Remove URLs from incoming messages (true or false). Defaults to false
    REMOVE_URLS=false
    # Comma-separated list of URLs to remove (reddit.com,youtube.com)
    REMOVE_URLS_LIST=google.com,twitter.com
    # Comma-separated list of URLs to exclude from removal (google.com,twitter.com).
    # Will be applied after the REMOVE_URLS_LIST
    REMOVE_URLS_WL=youtube.com,youtu.be,vk.com,twitch.tv,instagram.com
    # Disable mirror message deleting (true or false). Defaults to false
    DISABLE_DELETE=false
    # Disable mirror message editing (true or false). Defaults to false
    DISABLE_EDIT=false
    # Use an in-memory database instead of Postgres DB (true or false). Defaults to false
    USE_MEMORY_DB=false
    # Postgres credentials
    DATABASE_URL=postgres://user:pass@host/dbname
    # or
    DB_NAME=test
    DB_USER=test
    DB_HOST=test
    DB_PASS=test
    # Logging level (debug, info, warning, error or critical). Defaults to info
    LOG_LEVEL=info
  1. Make sure the account has joined source and target channels

Be careful with forwards from channels with restricted saving content. It may lead to an account ban.

If you want to bypass forward restriction, see RestrictSavingContentBypassFilter source to start.

Deploy

Host on Heroku:

Deploy

or manually:

  1. Clone project

    git clone https://github.com/khoben/telemirror.git
  2. Create new heroku app within Heroku CLI

    heroku create {your app name}
  3. Add heroku remote

    heroku git:remote -a {your app name}
  4. Set environment variables to your heroku app from .env by running bash script

    ./set_heroku_env.bash
  5. Upload on heroku host

    git push heroku master
  6. Start heroku app

    heroku ps:scale run=1

Locally:

  1. Create and activate python virtual environment

    python -m venv myvenv
    source myvenv/Scripts/activate # linux
    myvenv/Scripts/activate # windows
  2. Install dependencies

    pip install -r requirements.txt
  3. Run

    python main.py

Keep up-to-date with Heroku

If you deployed manually, move to step 2.

  1. Get project to your PC:

    heroku git:clone -a {your app name}
  2. Init upstream repo

    git remote add origin https://github.com/khoben/telemirror
  3. Get latest changes

    git pull origin master
  4. Push latest changes to heroku

    git push heroku master -f
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].