项目作者: Firemoon777

项目描述 :
telegram attachments in FUSE filesystem
高级语言: C
项目地址: git://github.com/Firemoon777/tgfs.git
创建时间: 2016-10-30T14:44:17Z
项目社区:https://github.com/Firemoon777/tgfs

开源协议:GNU General Public License v3.0

下载


tgfs Build Status

User space filesystem for Telegram attachments

API, Protocol documentation

Documentation for Telegram API is available here: http://core.telegram.org/api

Documentation for MTproto protocol is available here: http://core.telegram.org/mtproto

Installation from source

Install libs

Debian:

  1. sudo apt-get install fuse libfuse-dev libjansson-dev libreadline-dev libssl-dev libevent-dev

Arch Linux:

  1. sudo pacman -S fuse2 jansson readline libevent

Fedora:

  1. sudo dnf install fuse-devel libjansson-devel readline-devel readline-devel openssl-devel libevent-devel

Clone GitHub Repository

  1. git clone --recursive https://github.com/Firemoon777/tgfs.git && cd tgfs

Build

  1. ./configure && make

Then, install

  1. sudo make install

Installation from AUR (Archlinux)

  1. yaourt -S tgfs

Startup

You must run telegram-tgfs before the first launch of tgfs. telegram-tgfs is telegram-cli patched to show list of attachments.
After you have logged in you can use tgfs.

Usage

Create empty dir

  1. mkdir mnt

Mount tgfs

  1. tgfs mnt

ls -l interpretation

Filesystem root

  1. $ ls -l mnt
  2. drwx------ 0 firemoon firemoon 0 jan 12 21:12 Alex_Ivanov
  3. drwx-----T 0 firemoon firemoon 0 jan 12 22:22 Firemoon777
  4. dr-x------ 0 firemoon firemoon 0 jan 1 1970 Wizard's_jokes
  1. Permissions
    • rwx = user or chat (you can share anything)
    • r-x = public channel
    • sticky bit = self chat
  2. atime, ctime, mtime = last seen time
    • if time is equal to zero POSIX time, it means last active time is unknown
  3. display name

Directories with attachments

  1. $ ls Firemoon777/
  2. Audio Documents Photo Video Voice

Directory with all voice messages

  1. $ ls -lh Firemoon777/Voice/
  2. -r-------- 1 firemoon firemoon 2,9K aug 31 2015 '2015-08-31 08:30:08 - 1527876055.ogg'
  3. -r-------- 1 firemoon firemoon 4,9K sep 28 2015 '2015-09-28 07:09:20 - 3870023017.ogg

Sending document to user

  1. cp ~/test.zip test/Documents/Firemoon777/

Sending any media to user (file extention is important!)

  1. cp ~/000.gif mnt/Firemoon777/ # Uploaded as gif
  2. cp ~/001.jpg mnt/Firemoon777/ # Uploaded as photo
  3. cp ~/002.zip mnt/Firemoon777/ # Uploaded as document

Removing media (required --enable-unlink mount option)

  1. rm mnt/tgfs/Photo/remove_test.jpg

To do list:

  • Show profile picture
  • Setting profile photo with cp
  • [X] Removing attachments with rm
  • FIFO-like files for chatting

Known issues

  • No dialog list reloading (if you start a new chat, you should unmount and mount tgfs again)
  • No progress bars (big file will be copied in few seconds, but appears in tg within a minute)
  • No multithreading
  • Files with spaces in name doesn’t upload

Join

Project chat:
https://t.me/joinchat/AAAAAApRIgKzmYvzXeh_0w