OS : Ubuntu 21
Python : 3.10.4
- I'm using : python main.py --batch-file 'channels_text_file.txt' as source of channels, with one channel per line.
- I'm able to see the JSON/CSV files getting created
After a successful installation of the requirements, I'm able to run it
but after a while, a few minutes, it crashes with this error :
`Traceback (most recent call last):
File "/home/peer/tg-api/main.py", line 176, in
counter = write_collected_chats(
File "/home/peer/tg-api/utils/init.py", line 142, in write_collected_chats
ch['participants_count'] = process_participants_count(client, ch_id)
File "/home/peer/tg-api/utils/init.py", line 73, in process_participants_count
channel_request = loop.run_until_complete(
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/peer/tg-api/api/init.py", line 85, in full_channel_req
return await client(
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/site-packages/telethon/client/users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/site-packages/telethon/client/users.py", line 39, in _call
await r.resolve(self, utils)
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/site-packages/telethon/tl/functions/channels.py", line 720, in resolve
self.channel = utils.get_input_channel(await client.get_input_entity(self.channel))
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/site-packages/telethon/utils.py", line 263, in get_input_channel
_raise_cast_fail(entity, 'InputChannel')
File "/home/peer/.pyenv/versions/3.10.4/lib/python3.10/site-packages/telethon/utils.py", line 138, in _raise_cast_fail
raise TypeError('Cannot cast {} to any kind of {}.'.format(
TypeError: Cannot cast InputPeerChat to any kind of InputChannel.`
I'm not a Python dev in itself so any hint to help me in the right direction to debug this would be very appreciated,
I'm not 100% but this error could entirely be only on my end.