Giter Site home page Giter Site logo

kourva / tscraper Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 25 KB

Automated Telegram Scraper that scrapes data when you join the groups...

License: MIT License

Python 100.00%
python3 scraper-python scraper-tools telegram-api telegram-scraper telegram-selfbot

tscraper's Introduction

Tscraper

Automated Telegram Scraper that scrapes data when you join the groups




¶ About

Tscraper is an automated telegram group scraper tool with automated login process (You don't need to enter number or 2fa everytime you run the code). This scraper will run on your account and when you join the group, it will start scraping all members and save it into SQLite3 database... Note: This tool will not scrape Hidden Members in groups!


⌗ Installation

First of all, make sure you have python3 & git installed on your machine...

  1. Clone the repository:

    git clone https://github.com/Kourva/Tscraper
  2. Navigate to Tcraper and make Virtual Environment:

    cd Tscraper && virtualenv venv && source venv/bin/activate
  3. Install requirements:

    pip install -r requirements.txt

Let's pause the installation and configure some data...


✎ Configuration

For this scraper you need: api-ID || api-Hash || Phone-number || 2FA password

  • Get api-ID && api-Hash: Get your api-ID and api-Hash from official Telegram website. See help

Now open the credential.json and replace those data...

{
    "api_id": 11111111,                              // API ID here (Integer)
    "api_hash": "0000000000000000000000000000000",   // API Hash here (Str)
    "phone_number": "+1234567890",                   // Phone Number here (Includes +)
    "password": "test_password"                      // 2FA password (or leave blank)
}

Let's look at our SQLite3 database (You don't have to do somthing here):

CREATE TABLE "users" (
    "chat_id"     INTEGER UNIQUE,
    "username"    TEXT,
    "access_hash" TEXT
);

Sample: Database is located in Users/tuser.db

chat_id username access_hash
102948275 telegram_user -12c4qw32wkf12b8339b377
195467618 None 91qw382w419500139b1n26

★ Start & Run

Now let's start the bot. You can use proxy with proxychains or start it normally...

python main.py                    # Without proxy
proxychains -q python main.py     # With proxy (Edit proxy in /etc/proxychains4.conf)

You just need to type OTP code sent to your phone number, after logging, new session with your phone number as its name will be created in root directory of Tscraper . for example: 13412428592.session


ヅ Common Issues

If you get an error like this, Server sent a very new message with ID xxxxxxxxxxxxxxxxxxx, ignoring, just fix your device clock using ntpdate:

sudo ntpdate 0.pool.ntp.org && sudo hwclock -w

Don't act like a bot (like joining to many groups in short time), Telegram will ban your account, make sure to join groups with at least 60 seconds delay between each!


❦ Thanks for your support ❦

tscraper's People

Contributors

kourva avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.