alfem/telegram-download-daemon

[Suggestion] Filename

CFSO6459 opened this issue · 5 comments

If a video is sent to the chat as photo/video (instead of sending as a file), the daemon will name it as something like -da5gts3m (that is 8 characters of lowercase letters and/or numbers, starting with a dash, and no .mp4 suffix).
But if I download the same video using telegram web or windows app, the filename is something like 2877589252854127294.mp4 (that is 19 digits of numbers).

The problem is, if a video is sent to the chat twice, the daemon will name 2 videos differently, while the telegram app will give them the same name.

So, would you add the suffix to those .mp4 files when downloading, and is it possible to change the naming format to the telegram app style?

Thank you!

alfem commented

If a video is sent to the chat as photo/video (instead of sending as a file), the daemon will name it as something like -da5gts3m (that is 8 characters of lowercase letters and/or numbers, starting with a dash, and no .mp4 suffix).
But if I download the same video using telegram web or windows app, the filename is something like 2877589252854127294.mp4 (that is 19 digits of numbers).

Originally, this daemon was designed to help with file downloading. I added stream videos support recently but It is not throughly tested . I will check that file name issue though.

The problem is, if a video is sent to the chat twice, the daemon will name 2 videos differently, while the telegram app will give them the same name.

Well, that is a requested feature, not a bug. Some people are using this daemon in a group chat and they send different videos with the same name. So the daemon rename duplicated files to avoid overwrites.

Change user behaviour should be easier, but it is not in my hand :-D

alfem commented

I have improved file names in 1.10. Tests and feedback are welcome!

alfem commented

Just added a new option.

Now you can decide what to do with duplicated files: ignore, overwrite or rename them.

It is 1.11.

And thanks for the coffee! ;-)

That's great! And if it can download photos and GIFs (those are not sent as files), that will be even more awesome! 😃

alfem commented

I added some kind of support for photo downloading in 1.12. But I have no time now for a full test. I hope it will work for you.