IvanGlinkin / CCTV

Close-Circuit Telegram Vision revolutionizes location tracking with its open-source design and Telegram API integration. Offering precise tracking within 50-100 meters, users can monitor others in real-time for logistics or safety, redefining how we navigate our surroundings
GNU General Public License v3.0
2.37k stars 327 forks source link

struct.error: 'i' format requires -2147483648 <= number <= 2147483647 #2

Open Dhamareshwarakumar opened 5 months ago

Dhamareshwarakumar commented 5 months ago

While running the script I am getting the following error (followed instructiond as per README) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 what might be the issue causing this?

Detailed error

Telegram client initialization...Request caused struct.error: 'i' format requires -2147483648 <= number <= 2147483647: InvokeWithLayerRequest(layer=173, query=InitConnectionRequest(api_id=6981635625, device_model='arm64', system_version='23.4.0', app_version='1.34.0', system_lang_code='en', lang_pack='', lang_code='en', query=GetConfigRequest(), proxy=None, params=None))
Traceback (most recent call last):
File "/path/CCTV/start.py", line 108, in <module>
with TelegramClient(telegram_name, telegram_api_id, telegram_api_hash) as client:
IvanGlinkin commented 5 months ago

Your api_id is 6981635625 which should be in range between -2147483648 and 2147483647 Please check if you copy/pasted Telegram API ID and Hash correctly

alebedev80 commented 5 months ago

@IvanGlinkin Why this issue was closed? user id doesn't fit to int type. Please fix

IvanGlinkin commented 5 months ago

@IvanGlinkin Why this issue was closed? user id doesn't fit to int type. Please fix

you mean to implement the feature to check what user is inputting? Sorry, did not get the question.

paracosm17 commented 5 months ago

@IvanGlinkin Why this issue was closed? user id doesn't fit to int type. Please fix

you mean to implement the feature to check what user is inputting? Sorry, did not get the question.

I think he means that the user IDs in telegram switched from the int32 type to the int64 type in 2021. And the check -2147483648 <= number <= 2147483647 corresponds to the int32 type, while int64 is already 9223372036854775807.

But the exception is caused by the Telethon library and it swears not at the user's ID, but at the API ID. I'm not sure exactly what type the API ID should be int32 or int64.

Most likely, the API ID should not exceed 32 bits and the person simply entered their API ID incorrectly