├── config.py
├── README.md
└── scrapper.py
/config.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) @TheSmartBisnu
2 | # Channel: https://t.me/itsSmartDev
3 |
4 | # Pyrogram setup
5 | API_ID = "123456" # Replace this API ID with your actual API ID
6 | API_HASH = "XXXXXXXXXXX" # Replace this API HASH with your actual API HASH
7 | SESSION_STRING = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # Replace this SESSION STRING with your actual SESSION_STRING
8 | BOT_TOKEN = "12345678:XXXXXXXXXXXXXX" # Replace this BOT_TOKEN
9 |
10 | # Admin IDs
11 | ADMIN_IDS = [12345678, 12345678]
12 |
13 | # Limits
14 | DEFAULT_LIMIT = 10000 # Card Scrapping Limit For Everyone
15 | ADMIN_LIMIT = 50000 # Card Scrapping Limit For Admin
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
CC Scraper Telegram Bot
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | CC Scraper: An advanced Telegram bot script to scrape credit cards from specified Telegram groups and channels.
13 |
14 |
15 |
16 | ## Features
17 |
18 | - Scrapes cards from private/public Telegram groups and channels.
19 | - Supports format: group/channel username, ID, or link.
20 | - Scrapes specific BIN credit cards.
21 | - Removes duplicate credit cards.
22 | - Handles multiple requests at a time.
23 | - Super-fast scraping speed.
24 |
25 | ## Requirements
26 |
27 | Before you begin, ensure you have met the following requirements:
28 |
29 | - Python 3.8 or higher.
30 | - `pyrofork` and `tgcrypto` libraries.
31 | - A Telegram bot token (you can get one from [@BotFather](https://t.me/BotFather) on Telegram).
32 | - API ID and Hash: You can get these by creating an application on [my.telegram.org](https://my.telegram.org).
33 | - To Get `SESSION_STRING` Open [@SmartUtilBot](https://t.me/SmartUtilBot). Bot and use /pyro command and then follow all instructions.
34 |
35 | ## Installation
36 |
37 | To install `pyrofork` and `tgcrypto`, run the following command:
38 |
39 | ```bash
40 | pip install pyrofork tgcrypto
41 | ```
42 |
43 | **Note: If you previously installed `pyrogram`, uninstall it before installing `pyrofork`.**
44 |
45 | ## Configuration
46 |
47 | 1. Open the `config.py` file in your favorite text editor.
48 | 2. Replace the placeholders for `API_ID`, `API_HASH`, `SESSION_STRING`, and `BOT_TOKEN` with your actual values:
49 | - **`API_ID`**: Your API ID from [my.telegram.org](https://my.telegram.org).
50 | - **`API_HASH`**: Your API Hash from [my.telegram.org](https://my.telegram.org).
51 | - **`SESSION_STRING`**: The session string generated using [@SmartUtilBot](https://t.me/SmartUtilBot).
52 | - **`BOT_TOKEN`**: The token you obtained from [@BotFather](https://t.me/BotFather).
53 |
54 | 3. Optionally, adjust the following settings:
55 | - **`admin_ids`**: List of admin user IDs who have elevated permissions.
56 | - **`admin_limit`**: The maximum number of messages admins can scrape in a single request.
57 | - **`default_limit`**: The maximum number of messages regular users can scrape in a single request.
58 |
59 | ## Deploy the Bot
60 |
61 | ```sh
62 | git clone https://github.com/bisnuray/CC-Scrapper
63 | cd CC-Scrapper
64 | python scrapper.py
65 | ```
66 |
67 | ## Usage
68 |
69 | 1. Use the `/scr` command followed by the group or channel username and the number of messages to scrape.
70 |
71 | ```text
72 | /scr @channel_username 1000
73 | ```
74 |
75 | 2. Optionally, you can scrape any target bin cards
76 |
77 | ```text
78 | /scr @channel_username 1000 434769
79 | ```
80 |
81 | ✨ **Note**: If you found this repo helpful, please fork and star it. Also, feel free to share with proper credit!
82 |
83 | ## Author
84 |
85 | - Name: Bisnu Ray
86 | - Telegram: [@itsSmartDev](https://t.me/itsSmartDev)
87 |
88 | Feel free to reach out if you have any questions or feedback.
89 |
--------------------------------------------------------------------------------
/scrapper.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) @TheSmartBisnu
2 | # Channel: https://t.me/itsSmartDev
3 |
4 | import re
5 | import os
6 | import asyncio
7 | from urllib.parse import urlparse
8 | from pyrogram.enums import ParseMode
9 | from pyrogram import Client, filters
10 | from config import API_ID, API_HASH, SESSION_STRING, BOT_TOKEN, ADMIN_IDS, DEFAULT_LIMIT, ADMIN_LIMIT
11 |
12 | # Initialize the bot and user clients
13 | bot = Client(
14 | "bot_session",
15 | api_id=API_ID,
16 | api_hash=API_HASH,
17 | bot_token=BOT_TOKEN,
18 | workers=1000,
19 | parse_mode=ParseMode.HTML
20 | )
21 |
22 | user = Client(
23 | "user_session",
24 | session_string=SESSION_STRING,
25 | workers=1000
26 | )
27 |
28 | scrape_queue = asyncio.Queue()
29 |
30 | def remove_duplicates(messages):
31 | unique_messages = list(set(messages))
32 | duplicates_removed = len(messages) - len(unique_messages)
33 | return unique_messages, duplicates_removed
34 |
35 | async def scrape_messages(client, channel_username, limit, start_number=None):
36 | messages = []
37 | count = 0
38 | pattern = r'\d{16}\D*\d{2}\D*\d{2,4}\D*\d{3,4}'
39 | async for message in user.search_messages(channel_username):
40 | if count >= limit:
41 | break
42 | text = message.text if message.text else message.caption
43 | if text:
44 | matched_messages = re.findall(pattern, text)
45 | if matched_messages:
46 | formatted_messages = []
47 | for matched_message in matched_messages:
48 | extracted_values = re.findall(r'\d+', matched_message)
49 | if len(extracted_values) == 4:
50 | card_number, mo, year, cvv = extracted_values
51 | year = year[-2:]
52 | formatted_messages.append(f"{card_number}|{mo}|{year}|{cvv}")
53 | messages.extend(formatted_messages)
54 | count += len(formatted_messages)
55 | if start_number:
56 | messages = [msg for msg in messages if msg.startswith(start_number)]
57 | messages = messages[:limit]
58 | return messages
59 |
60 | @bot.on_message(filters.command(["scr"]))
61 | async def scr_cmd(client, message):
62 | args = message.text.split()[1:]
63 | if len(args) < 2 or len(args) > 3:
64 | await message.reply_text("⚠️ Provide channel username and amount to scrape")
65 | return
66 | channel_identifier = args[0]
67 | limit = int(args[1])
68 | max_lim = ADMIN_LIMIT if message.from_user.id in ADMIN_IDS else DEFAULT_LIMIT
69 | if limit > max_lim:
70 | await message.reply_text(f"Sorry Bro! Amount over Max limit is {max_lim} ❌")
71 | return
72 | start_number = args[2] if len(args) == 3 else None
73 | parsed_url = urlparse(channel_identifier)
74 | channel_username = parsed_url.path.lstrip('/') if not parsed_url.scheme else channel_identifier
75 | try:
76 | chat = await user.get_chat(channel_username)
77 | channel_name = chat.title
78 | except Exception:
79 | await message.reply_text("Hey Bro! 🥲 Incorrect username ❌")
80 | return
81 | temporary_msg = await message.reply_text("Scraping in progress wait.....")
82 | scrapped_results = await scrape_messages(user, chat.id, limit, start_number)
83 | unique_messages, duplicates_removed = remove_duplicates(scrapped_results)
84 | if unique_messages:
85 | file_name = f"x{len(unique_messages)}_{channel_name.replace(' ', '_')}.txt"
86 | with open(file_name, 'w') as f:
87 | f.write("\n".join(unique_messages))
88 | with open(file_name, 'rb') as f:
89 | caption = (
90 | f"CC Scrapped Successful ✅\n"
91 | f"━━━━━━━━━━━━━━━━\n"
92 | f"Source: {channel_name}\n"
93 | f"Amount: {len(unique_messages)}\n"
94 | f"Duplicates Removed: {duplicates_removed}\n"
95 | f"━━━━━━━━━━━━━━━━\n"
96 | f"Card-Scrapper By: Smart Dev\n"
97 | )
98 | await temporary_msg.delete()
99 | await client.send_document(message.chat.id, f, caption=caption)
100 | os.remove(file_name)
101 | else:
102 | await temporary_msg.delete()
103 | await client.send_message(message.chat.id, "Sorry Bro ❌ No Credit Card Found")
104 |
105 | if __name__ == "__main__":
106 | user.start()
107 | bot.run()
108 |
--------------------------------------------------------------------------------