Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mount without id file tag? #11

Open
radebla opened this issue Aug 14, 2023 · 5 comments
Open

How to mount without id file tag? #11

radebla opened this issue Aug 14, 2023 · 5 comments

Comments

@radebla
Copy link

radebla commented Aug 14, 2023

Hi all!

Thank you so much for your program and code, it is excellent.

When I mount a group or a chat I'd like view files without id file tag --->123_filename.ext ; I want ---> filename.ext

I'm still diving on the code and don't find the way to delete it, change it or move the id file tag to an other position like ---> filename_123.ext

Anyone can help me? Thanks in advance!

@jpruciak
Copy link

this is a great example why #4 is a good idea

@radebla
Copy link
Author

radebla commented Aug 14, 2023

Hi! Yes I watched this post, but doesn't work for me, maybe I dont use correct format:

tgmount --format '{msgid}{filename}' mount ............. /mnt/.........
usage: tgmount [-h] [--session SESSION] [--tgapp TGAPP] [--debug] [--debug-fs-ops] [--use-ipv6]
{mount-config,mount,validate,download,list} ...
tgmount: error: argument command: invalid choice: '{msgid}
{filename}' (choose from 'mount-config', 'mount', 'validate', 'download', 'list')

Where I should write this argument correctly? Thanks in advance.

@nktknshn
Copy link
Owner

nktknshn commented Sep 9, 2023

Hi! Apologies for the delayed response. If you remove the leading message id, there is a high possibility of file names collisions: documents with identical file names may appear in a chat more than once. Additionally, some documents do not have specific file names and are assigned generic names like photo.jpeg, video.mp4 or document.

To address this, we could have used a prefixed name for a repeating file name, such as:

archive.zip, 2_archive.zip, 3_archive.zip

However, if second message is removed, the file names would become:
archive.zip, 3_archive.zip

After tgmount restarted this will turn into:
archive.zip, 2_archive.zip

Therefore, this requires saving the mapping message -> filename for every folder in the mount point to make file names consistent between restarts. Too much additional functionality to just remove the leading message id... Gotta think how to handle multipart archives though.

file names are defined in this file, but tgmount internals expect file names to be unique so far

class MessageWithSticker(

@radebla
Copy link
Author

radebla commented Sep 27, 2023

Thank you so much for your response.

Yep, I understand everything, but for my case, it is mandatory that the file names hasn't have a prefixed name to do a library can read from mount group. So I can been careful to the files inside of group to do this application.

I'll try your changes for my application.

Kind regards.

@wes1993
Copy link

wes1993 commented Feb 2, 2024

@radebla,
Hello I'm in the same situation, have you found a way to mount media without MessageID?

Best Regards
Stefano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants