GithubHelp home page GithubHelp logo

indywka / instagram-to-telegram Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chdelacr/instagram-to-telegram

0.0 0.0 0.0 26 KB

Send your latest Instagram posts to your Telegram channel with instagrapi and a Telegram bot.

Python 100.00%

instagram-to-telegram's Introduction

Instagram posts to Telegram channel

Send your latest Instagram posts to your Telegram channel with instagrapi and a Telegram bot.

Helpful links to create a sftp connection on windows

1 2 3 4

Features

  • Shares pictures, albums and videos
  • Optional login to pull private posts
  • Only shares posts that have not been shared
  • Use of SFTP for creating checkpoint files
  • Uses secrets as environment variables
  • Runs with GitHub Actions

Prerequisites

  • Defining GitHub Secrets as environment variables
  • Python 3.11+ (for local run)
  • Telegram bot (follow the guide)
  • Instagram account (optional login, but required when pulling public data fails)

Getting started

Customize the configuration by setting up the required parameters, either in GitHub Secrets or the .env file:

Parameter Description
INSTAGRAM_USERNAME Your Instagram username
INSTAGRAM_PASSWORD Your Instagram password (optional)
TELEGRAM_BOT_TOKEN Your Telegram bot token (use BotFather to create your bot by following this guide)
TELEGRAM_CHANNEL_ID Your Telegram channel ID (if public, @channel_name; if private, forward a message from the channel to GetIDs Bot and use the ID from "Origin chat" that starts with -100)
SFTP_SERVER Your SFTP server
SFTP_USERNAME Your SFTP username
SFTP_PASSWORD Your SFTP password
SFTP_PATH Your SFTP path

Please note that PRIVATE_ACCESS is set by default to "N" in the .env file.

Running with GitHub Actions

  1. Fork the repo
  2. Open your repo settings
  3. Go to "Security > Secrets and variables > Actions"
  4. Create and define your parameters with the button "New repository secret"
  5. Push any change to the main branch to trigger the job

Due to limitations with GitHub Actions, jobs are executed every 6 hours, and in-progress jobs are canceled if a new job is executed before that.

Running locally

  1. Clone the repository and navigate to the project directory:
    git clone https://github.com/chdelacr/instagram-to-telegram.git
    cd instagram-to-telegram
  2. Update the .env file with your parameters between double quotes ("")
  3. Create and activate a virtual environment:
    python -m venv venv
    
    # Linux and macOS:
    source venv/bin/activate
    
    # Windows:
    venv\Scripts\activate
  4. Install dependencies:
    pip install -r requirements.txt
  5. Run the job:
    python main.py

Credits

Disclaimer

This is a personal project and is not affiliated with Instagram or Telegram in any way.

instagram-to-telegram's People

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.