Skip to content

Kourva/Tscraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ❦

Releases

No releases published

Packages

No packages published

Languages