Dineshkarthik/telegram_media_downloader

Error during compiling

RyterX opened this issue · 1 comments

Describe the bug
A clear and concise description of what the bug is.

I'm trying to configure the script, but this happens every time I start it and I can't figure out what it is:

  • I have entered the id of the channel from which it should take the data
  • I gave it the token of the bot it needs to talk to, added it to the channel and gave it the admin powers
    and so far so good, then it immediately goes into error and this is what I pasted. I made a change to the "pagination_limit" from 100 to 5000, because it was one of the first errors that came up. In fact, it doesn't come out any more, but it still generates this error.

I should point out that the channel in which I inserted the bot was not created from scratch but already existed, with 3800 messages (files) sent.

Python Version
Python: 3.7.3

OS:
W10

Logs

Traceback (most recent call last):
File "media_downloader.py", line 376, in
main()
File "media_downloader.py", line 361, in main
begin_import(config, pagination_limit=100)
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
File "media_downloader.py", line 327, in begin_import
async for message in messages_iter: # type: ignore
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\methods\messages\get_chat_history.py", line 122, in get_chat_history
reverse=reverse
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\methods\messages\get_chat_history.py", line 51, in get_chunk
sleep_threshold=60
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\methods\advanced\invoke.py", line 83, in invoke
else self.sleep_threshold)
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\session\session.py", line 389, in invoke
return await self.send(query, timeout=timeout)
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\session\session.py", line 357, in send
RPCError.raise_it(result, type(data))
File "C:\Users\emlau\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pyrogram\errors\rpc_error.py", line 97, in raise_it
is_signed=is_signed)
pyrogram.errors.exceptions.bad_request_400.BotMethodInvalid: Telegram says: [400 BOT_METHOD_INVALID] - The method can't be used by bots (caused by "messages.GetHistory")

Please follow the configuration step as mentioned here to get user api id and api key instead of using bot token