Wow amazing work. I'm gonna watch this video as many times as I and so I can understand it because this is very interesting and very precisely good with information. You are awesome thank you so much.
Mr. Amir, thank you for this! I have two questions: 1. Was wondering if it is possible to extract messages from multiple channels and each have its own json file? 2. Set this up in a cron job. How to deal with the login? Appreciate it, thank you very much :)
1. For that you need to either run multiple instances of this script or make a little adjustment in the code to read a list of channels and go through them on a loop. 2. After the first time you do the login process, there will be a session file created for your Telegram account so the next time you don't need to do the login. But be careful about where you run this script because with those session files there's a possibility to login to your Telegram account.
This was fantabulous i have a trouble...need your suggestion I'm able to scrape the entire groups msg data with your script however i want to scrape only recent 100 msg in a loop and check for some keywords in that message! is it possible?
Excellent work. But there is a problem: After the phone number comes this error "The api_id/api_hash combination is invalid (caused by SendCodeRequest)". I have checked api_id/api_hash combination and it is rights. Looking around there is a lot of people with the same issue.
Hi Amir, I´ve got this error :( RuntimeWarning: coroutine 'UserMethods.is_user_authorized' was never awaited if not client.is_user_authorized(): RuntimeWarning: Enable tracemalloc to get the object allocation traceback Is this familiar to you?
bro i gave channel url but i got this error....... if not participants.users: AttributeError: 'coroutine' object has no attribute 'users' sys:1: RuntimeWarning: coroutine 'UserMethods.__call__' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Hello Amir, this is very useful and I am having issues that the code is not scraping the text if the post is attached photos or videos, do you have any suggestions ?
Hi, can you add me more part to this with, how to get updates of an already given message, and also how scrape a channel from its inception or creation time which means to get its data from the creation time or a specific time in the past? I appreciate this gonna be helpful.
thank you Amir I have a question is it possible to make a bulk message to all the members of my channel. because you see I am organizing a big event and I would like to reach each member in particular
Amir thanks a lot for your code! I have a question, in the console when it asks to enter the phone number, what format should I use? For example, for a telephone number from Argentina, the country code is 54. I have the config.ini file well configured.
hi there, sometimes the app is takin too long time to scrap, and even doesn`t stop. how to fix it. or how to make it to search messages with specific keyword?
Seems like a project to me 😀 I'm not currently available to record this much of work but you can send an inquiry to my email explaining your needs in details.
How do I modify this script to read only the latest incoming message continuously in a private telegram channel and deploy the script in a serverless environment (like AWS lambda)?
Hello,THhank you fore the post, it's very useful, I would like to get audios from a channel wich is a course channel on a weekly bases. If I need every wensdays' class' audio from the oldest to the newest, wich modification should I give to the code. Thank you dear Amir! Allahumma baarik fiik!
Whenever launching telethon from an existing session I receive two error messages: Server sent a very new message with ID xxxxxxxxxxxxxxxxxxx, ignoring Server sent a very new message with ID xxxxxxxxxxxxxxxxxxx, ignoring. Could you help me, thanks
Traceback (most recent call last): File "c:\Users\gokha\Desktop\telegram-analysis-master\ChannelMessages.py", line 31, in api_id = config['Telegram']['api_id'] File "C:\Users\gokha\anaconda3\lib\configparser.py", line 963, in __getitem__ raise KeyError(key) KeyError: 'Telegram' i've got this error after i copied config.ini and try to run ChannelMessages. could you pls help me ?
@@emansarahafi not working me i'm stuck here PS C:\Users\Issam\Downloads\telegram-analysis-master> Python ChannelMessages.py Traceback (most recent call last): File "C:\Users\Issam\Downloads\telegram-analysis-master\ChannelMessages.py", line 31, in api_id = config['Telegram']['api_id'] File "C:\Users\Issam\AppData\Local\Programs\Python\Python310\lib\configparser.py", line 964, in __getitem__ raise KeyError(key) KeyError: 'Telegram'
@all I'm experiencing a weird bug, when reading messages from a test group I made.. it reads weird messages, and I think that is because I am reading messages from another telegram users account for some reason? I do not know why this is happening because I used my own phone number and the login on my account was successful. any one experienced the same and how did you fix this? also, great tutorial ang code
sir, what is this error. Warning (from warnings module): File "E:/TelegramBot/amirbot.py", line 25 if not client.is_user_authorized(): RuntimeWarning: coroutine 'UserMethods.is_user_authorized' was never awaited
Logically yes, as you can not see other channels members in Telegram. But for groups, If you are a member of it and group admin don't restrict members list from being seen you can grab groups list.
thanks for the source code I have tried to get users from my channel but i am able to get only 200 users how can I get more than 200 users. I have more than 1200 users in my channel
error telethon.errors.rpcerrorlist.ChatAdminRequiredError: Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group (caused by GetParticipantsRequest)
Have a look here on source code
github.com/amiryousefi/telegram-analysis
I'm very happy and proud to see a "ham vatan" has a great youtube channel like this. khoda ghovat ;)
Thank you so much, I have my project where I need to repost some news from a channel, this saves my life!
Can we get any channel messages
دمت گرم خیلی دنبال اینجور آموزشی میگشتم
Great, Telegram is the best messenger in the world 💪
And it's very developer friendly!
Thank you Amir, this helped me out so much!
Can we get any channel messages
Great! Very helpful video!
The Medium article helped me a lot too.
Glad it helped!
Can we get any channel messages
Wow amazing work. I'm gonna watch this video as many times as I and so I can understand it because this is very interesting and very precisely good with information. You are awesome thank you so much.
You Helped me immensly!!! thank you so much good Sir! I was looking and looking everywhere but could not find this!
i need your help please comment back
beautiful work! Thanks you
Thank you very much you are amazing!!!!
Glad you liked it!
Mr. Amir, thank you for this! I have two questions:
1. Was wondering if it is possible to extract messages from multiple channels and each have its own json file?
2. Set this up in a cron job. How to deal with the login?
Appreciate it, thank you very much :)
1. For that you need to either run multiple instances of this script or make a little adjustment in the code to read a list of channels and go through them on a loop.
2. After the first time you do the login process, there will be a session file created for your Telegram account so the next time you don't need to do the login. But be careful about where you run this script because with those session files there's a possibility to login to your Telegram account.
Did you come up with a working loop for the task in question 1?
Its helpful, tnx.
This was fantabulous
i have a trouble...need your suggestion
I'm able to scrape the entire groups msg data with your script
however i want to scrape only recent 100 msg in a loop and check for some keywords in that message!
is it possible?
You need to add some code inside the for loop to count the message numbers and maybe a function to check for your keyword in the scrapped message.
thanks amir
it's very useful
Hey can we get any channel messages which is private and we are not part of it
Excellent work. But there is a problem: After the phone number comes this error "The api_id/api_hash combination is invalid (caused by SendCodeRequest)". I have checked api_id/api_hash combination and it is rights. Looking around there is a lot of people with the same issue.
Great!! Thanks
thanks for good share.
Great video thanks! Will the script you provided retrieve all message information I.e. user-id, forwarded_from etc.?
Thank you Amir for this amazing tutorial! Is username just username and not the URL of the username?
thanks a lot!
How to get message of private group with out membership but using link
Thanks a lot
A question mr Amir Yousefi, does it take real time messages? or is there some sort of delay? thanks in advance
Hi Amir, I´ve got this error :( RuntimeWarning: coroutine 'UserMethods.is_user_authorized' was never awaited
if not client.is_user_authorized():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback Is this familiar to you?
I'm not facing this issue.
Could you please check the latest code from GitHub and check your Python version and requirements?
Bro this now not working
bro i gave channel url but i got this error....... if not participants.users:
AttributeError: 'coroutine' object has no attribute 'users'
sys:1: RuntimeWarning: coroutine 'UserMethods.__call__' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Hello Amir, this is very useful and I am having issues that the code is not scraping the text if the post is attached photos or videos, do you have any suggestions ?
How do I get only the last message, in looping?
did you find the solution?
so I have tried to use your software but getting error with telethon.sync inport telegramchannel, can you please help me how to resolve this issue.
Can you provide your error message?
If I want to scrap the subtopic/topic info chat from the group, could it be use the same script?
Hi, can you add me more part to this with, how to get updates of an already given message, and also how scrape a channel from its inception or creation time which means to get its data from the creation time or a specific time in the past?
I appreciate this gonna be helpful.
How do I stop my account from getting banned? It gets banned after a few hundred messages
Then active source have gived KeyError: 'Telegram' how to fix it error ?
🤙👍👍👍
I had a problem:
File "ChannelMessages.py", line 42
async def main(phone):
^
SyntaxError: invalid syntax.
How can i fix it?
thank you Amir I have a question is it possible to make a bulk message to all the members of my channel. because you see I am organizing a big event and I would like to reach each member in particular
how can i add a filter to only read certain messages plz
Amir thanks a lot for your code! I have a question, in the console when it asks to enter the phone number, what format should I use? For example, for a telephone number from Argentina, the country code is 54. I have the config.ini file well configured.
i solved, sorry. Thanks for your code!!!
So does this code only pull messages from a channel if you are the owner of it?
hi there, sometimes the app is takin too long time to scrap, and even doesn`t stop. how to fix it. or how to make it to search messages with specific keyword?
empty response is coming why? i.e nothing n json file only [] is there
Pls, Can you help with a Telegram BOT that can read from telegram group and automate the command on trading broker
Seems like a project to me 😀
I'm not currently available to record this much of work but you can send an inquiry to my email explaining your needs in details.
How do I modify this script to read only the latest incoming message continuously in a private telegram channel and deploy the script in a serverless environment (like AWS lambda)?
Hello,THhank you fore the post, it's very useful, I would like to get audios from a channel wich is a course channel on a weekly bases. If I need every wensdays' class' audio from the oldest to the newest, wich modification should I give to the code. Thank you dear Amir! Allahumma baarik fiik!
Sir if I type my phone number then shows error about invalid api key
Did you set everything correct in the configuration file?
@@AmirYousefi got it sir, how I get the latest message from channels
Whenever launching telethon from an existing session I receive two error messages:
Server sent a very new message with ID xxxxxxxxxxxxxxxxxxx, ignoring Server sent a very new message with ID xxxxxxxxxxxxxxxxxxx, ignoring. Could you help me, thanks
Is it possible to extract quiz from telegram ?
Traceback (most recent call last):
File "c:\Users\gokha\Desktop\telegram-analysis-master\ChannelMessages.py", line 31, in
api_id = config['Telegram']['api_id']
File "C:\Users\gokha\anaconda3\lib\configparser.py", line 963, in __getitem__
raise KeyError(key)
KeyError: 'Telegram'
i've got this error after i copied config.ini and try to run ChannelMessages. could you pls help me ?
hah...I have the same problem, it seems that using python scripts requires understanding the whole process
by the way...be sure to rename the config file properly!
I had the same problem but it worked when I replaced config.ini in the line config.read("config.ini") with the entire path to the file instead.
@@emansarahafi not working me i'm stuck here
PS C:\Users\Issam\Downloads\telegram-analysis-master> Python ChannelMessages.py
Traceback (most recent call last):
File "C:\Users\Issam\Downloads\telegram-analysis-master\ChannelMessages.py", line 31, in
api_id = config['Telegram']['api_id']
File "C:\Users\Issam\AppData\Local\Programs\Python\Python310\lib\configparser.py", line 964, in __getitem__
raise KeyError(key)
KeyError: 'Telegram'
you can simply hard code the values in variables and then run the script.
But still this script is not showing me any msg. IDK why
Hi Amir, thanks for the useful tutorial! Could you explain the purpose of using async and await in this script?
Hello sir,
While I am trying to run channelusers file I am getting chat admin privileges are required error. Can you please tell me how to resolve it?
@all I'm experiencing a weird bug, when reading messages from a test group I made.. it reads weird messages, and I think that is because I am reading messages from another telegram users account for some reason? I do not know why this is happening because I used my own phone number and the login on my account was successful. any one experienced the same and how did you fix this?
also, great tutorial ang code
sorry for my english
This code cant read private or public channel that make copyright on their messages 😢
سلام از ایران وقتی می خوام api hash را بگیرم ارور میده راه حل نداره؟
Hi, thanks for video! I get struct.error: argument out of range Task was destroyed but it is pending!
How can i use it to get messages of a telegram private channel pls help me
You can do so If you are a member of that Telegram channel.
@@AmirYousefi But how to do it? Search a lot but there is no way.....Please guide me.
I want to get users list with telegraf (Nodejs) , you have any hint for me ?m
Hi, i have lost my channel ownership can u help?
it is possible to see others channels members list?
Generally Telegram only allow you to see your own channel/groups members list. For other channels/groups you need administrative permissions.
sir, what is this error. Warning (from warnings module):
File "E:/TelegramBot/amirbot.py", line 25
if not client.is_user_authorized():
RuntimeWarning: coroutine 'UserMethods.is_user_authorized' was never awaited
Pull latest code from GitHub, I can't reproduce this error.
thanks..
Dear, it seems that only members from one's own channel can be scrapped as it's is asking for admin privileges when tried on others channel
Logically yes, as you can not see other channels members in Telegram. But for groups, If you are a member of it and group admin don't restrict members list from being seen you can grab groups list.
Code Error Mide
Hi, I can read the data but none of the comments they make
How to save the information in Telegram notification?
Is there a way to retrieve messages from a private chat with another person?
doesn't work for private channels
Bhai private channel ma kam nai krta kya
Does this work even if the channel I am in does not have a link?
How to read media files from the messages ?
keep getting this error OperationalError: database is locked
امیر جان این کد هنوز کار می کنه؟
Which brand are you use monitor?
It's a Xiaomi one( Mi surface 34")
this works for private channels? or just for public?
both since you are using your telegram credentials
dadash zaban farsi ro chetori mishe encode decode kard , toye data base hexegan miare
thanks for the source code I have tried to get users from my channel but i am able to get only 200 users how can I get more than 200 users. I have more than 1200 users in my channel
I've got this answer from StackOverflow, but I need to test it in my source code.
stackoverflow.com/a/47899940/2536118
Lol sorry I watch but don't really understand what the bot does
Maybe because it's not a bot 😀
my telegram account got banneed after this
Good job bro, JESUS IS COMING BACK VERY SOON; WATCH AND PREPARE
error
telethon.errors.rpcerrorlist.ChatAdminRequiredError: Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group (caused by GetParticipantsRequest)
i got this problem telethon.errors.rpcbaseerrors.AuthKeyError: RPCError 406: UPDATE_APP_TO_LOGIN (caused by SignInRequest)