alfem/telegram-download-daemon

edite and delete messages

Closed this issue · 13 comments

Hi
It would be useful if there was only one answer for each file and it was edited. I have tried modifying with client.edit_message and it works if you only download 1 in 1
the problem comes when there are multiple files in the queue. I do not know how to do it. I mention it in case you want to add this function
in the code I see% download but when I use it it only appears in queue, downloading and finish

alfem commented

I think it is working fine with the latest changes. Please test it and give me some feedback if you can.

I think it is working fine with the latest changes. Please test it and give me some feedback if you can.

now no message appears. download but does not report anything. list, status etc does not work either

and I don't know why now many files stop after downloading about 12 MB, others have just downloaded but I don't know how to rename or move to their final destination.

hi. I edit your script for delete messages (if it's all ok)

async for message in client.iter_messages(event.chat_id,reply_to=event.message.id):
            	await client.delete_messages(event.chat_id,message.id)
await client.delete_messages(event.chat_id,event.message.id)
alfem commented

There is something wrong with message edition in streamed videos. I am working on it.

alfem commented

Does that one work?

alfem commented

I think it is fixed now. Try the new version, please.

now it downloads perfectly but the commands only wwork with the main account (nota for other Users)

i use this for better display progresa

>>> from hurry.filesize import size
>>> await log_reply(message, f"{percentage} % ({size(received)} / {size(total)})")

alfem commented

Nice, but you need to install another library, don't you? ;-)

some times i get this error

Downloading file MiXplorer_12_1_2020_14-41-58.mic (2141655 bytes)
30.6 % (640K / 2M)
55.08 % (1M / 2M)
85.68 % (1M / 2M)
/datos/telegrams/telegram-download-daemon.py:181: RuntimeWarning: coroutine 'set_progress' was never awaited
  set_progress(filename, message, 100, 100)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
MiXplorer_12_1_2020_14-41-58.mic Uploading
await log_reply(message, f"{filename} ready")

and rename is not processed

alfem commented

now it downloads perfectly but the commands only wwork with the main account (nota for other Users)

Commands are working here. Please, open a new issue and do not forget to report your python version.