ThorData - Best Residential Proxy Provider
  Guest viewing is limited

Python/Perl/Bash Grabber of profits from chats and telegram channels in Python

K4NITEL

Administrator
Staff member
Admin
Joined
Jun 18, 2022
Messages
43
Hellcoins
♆497
Today we will write a grabber of privnotes from different chats or channels in the telegram. First, let's go through the dependencies.
You must reply before you can see the hidden data contained here.
These are all the dependencies that we will need, PySocks is needed if you cannot directly connect to telegrams.
So let's start by importing everything we need.
You must reply before you can see the hidden data contained here.
After we imported everything that we needed, we can start by creating a telegram client.
We go to https://my.telegram.org/auth , log in under the account from which we want to monitor chats, then create our own application, I think it will be easy for you to do.

ef947c70-07fc-43ec-a239-b92a6ffbd92e.png



From here we need api_id and app api_hash. Don't tell them to anyone.
Further, according to the Telethon documentation, we need to create our own client.

You must reply before you can see the hidden data contained here.
Let's figure out what and how. I think you have already figured out the Api_id and Api_hash fields, you need to insert your data that you received when registering the application there. In Phone, we insert the account number through which we will listen to chats. In the Chat field, we need to specify where the text from Privnot will be sent. You can insert a username without @ and a link to any chat of this type:
You must reply before you can see the hidden data contained here.
Further, if you do not have a connection to a telegram without a proxy, then enter the proxy ip and port.
Then we create a client:
You must reply before you can see the hidden data contained here.
Where the inscription 'coma' you can insert any name, this will be the name of the session file. Next, we have a socks5 proxy connection.
How the code without proxy should look like:
You must reply before you can see the hidden data contained here.
Next, we create an event in order to listen to all chats in the telegram.
You must reply before you can see the hidden data contained here.
Then we need to make a search condition for the link of the private.
You must reply before you can see the hidden data contained here.
That is, if event.raw_text contains a link like https://privnote.com/
event , this is an event. Raw_text is the text of the message in this event. And, if he finds a link in the message, he will pass the case on. And then we will have a regular season in order to pull out the link to the private:
You must reply before you can see the hidden data contained here.
That is, he will look for a link in the message where it was https://privnote.com/
Then we need to read the private note itself.
You must reply before you can see the hidden data contained here.
Well, almost the last thing, we need to send the text of the message from the private to the chat or to the person.
You must reply before you can see the hidden data contained here.
Well, we end it all:
You must reply before you can see the hidden data contained here.
The following is a complete listing of the program.
You must reply before you can see the hidden data contained here.
After launch, we will be asked to go through authorization, enter our number through the plus, then the code that came to the telegram. That's all, the script works, we can test it.
QUOTE:
I'm not the best coder, I'm just starting to write something interesting, don't follow my example. You can always do better, or not repeat my mistakes.
 
Top