-
Notifications
You must be signed in to change notification settings - Fork 227
limit to the number of phone numbers? #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
According to my test, for batch numbers, you need to wait 270 - 280 seconds after 30 - 40 numbers. Otherwise, you will get a FloodException. |
OK, thank you, I will set the query interval to 20s, it seems that at present there is also a problem, at present I test is with the api registered mobile phone number of the same country code of the mobile phone number can be detected, other countries and regions directly in the mobile phone address book to add the retrieved users, using this program but can not retrieve the display "error": "No response, the No response, the phone number is not on Telegram or has blocked contact adding.", when I changed to a brand new api, I found that it can detect the above mobile phone numbers in different countries and regions again, the main problem is how to avoid the api being banned by telegram! |
the biggest problem is there is a limit of the max number for it , so we couldn't use it automally for a lot of numbers. |
I googled an old thread on Stack Overflow, which leading to an old thread on reddit. It seems batch import less than 5000 numbers (which is the up limit of a batch import) is possible, then wait a long while (but nobody knows how long), and then you can add another batch of 5000 numbers. The solution in this project is that, it only imports one number at a time (even you give a list of numbers in commadline), and then delete it while ImportContactsRequest accepts a list of numbers. So, I think you guys can modify the main.py and import 5000 numbers at a time to see if it works. As for me, I don't have any telegram account to test now. |
Yes, I noticed that,too. My second test was on a remote box in africa, it reached about 65 results, which is more than my first test. After that, no more response. The cell number I used to register telegram api and the target numbers are in different countries. So I guess this is not an issue. As "No response, the phone number is not on Telegram or has blocked contact adding", This is not the original response by telegram, it's wrapped by this project when telegram gives an empty list. |
There is a limit to the maximum number of queries! ? Could you tell me how much it is? |
Sorry, I don't understand what you mean by "Stack Overflow has a programme that can batch query less than 5000 users at a time?" What do you mean by that solution is importing 5000 numbers at a time, is it a one time query using commas or do you mean not breaking the link to query 5000 numbers in turn. |
Check two links below:
According to these two links, batch import 5000 contacts at a time is supported by telegram api. def get_names(client: TelegramClient, phone_numbers: list) -> dict:
# a list to hold 5000 InputPhoneContact objects
inputPhoneContact_list = []
for phone_number in phone_numbers:
inputPhoneContact_list.append(InputPhoneContact(client_id = 0, phone = phone_number, first_name="", last_name=""))
contacts = client(functions.contacts.ImportContactsRequest(importContactPhone_list)) Hope it helps. |
Is there a limit to the number of mobile phone numbers you can get?
请问获取手机号数量有限制吗?
The text was updated successfully, but these errors were encountered: