devdetour / TelegramFUSE

A FUSE filesystem written in Python for reading and writing files to and from Telegram.
307 stars 36 forks source link

Keep In Mind

Though Telegram allows file uploads, it is not intended to be used as cloud storage. Your files could be lost at any time. Don't rely on this project (or any similar ones) for storing important files on Telegram. Storing large amounts of files on this could result in Telegram deleting your files or banning you, proceed at your own risk.

TelegramFS

A FUSE program that stores files on Telegram.

Though I demonstrated Discord in the video too, I haven't included the code here. While I believe that storing your OWN files on Discord does NOT violate TOS, I think that spreading the code to do so might. Idk I'm trying to not actually get banned :)

Usage and How to Run

Requirements

To Run

Before running this, I recommend creating a virtual environment in Python.

Known Issues

Uploading large files to Telegram (more than ~3GB) may result in degraded performance or the system killing the process for using too much memory. This is probably my fault. I found the behavior of memory management in Python is a bit strange, even calling gc.collect() after clearing the buffer doesn't always seem to work. It could also be an issue with the LRU cache I implemented... I don't have the patience to wait 20 minutes for it to crash and then debug, especially because the vast majority of my files are pretty small.

Error handling is somewhat lacking. If Telegram uploads fail, you'll probably see message in console, but it won't retry. Worst case, you can delete whatever file you were trying to upload and try again.

TO UNMOUNT, IF SOMETHING BREAKS

fusermount -u <path/of/your/mount>