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!
First of all, make sure you have python3 &
git
installed on your machine...
-
Clone the repository:
git clone https://github.com/Kourva/Tscraper
-
Navigate to Tcraper and make Virtual Environment:
cd Tscraper && virtualenv venv && source venv/bin/activate
-
Install requirements:
pip install -r requirements.txt
Let's pause the installation and configure some data...
For this scraper you need: api-ID
|| api-Hash
|| Phone-number
|| 2FA password
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 |
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
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!