nktknshn / tgmount Goto Github PK
View Code? Open in Web Editor NEWMount Telegram dialogs and channels as a Virtual File System.
License: Apache License 2.0
Mount Telegram dialogs and channels as a Virtual File System.
License: Apache License 2.0
:<
Unfortunately, it is throwing up an error.
$ python3 tgmount.py --list-documents --id 793392913 --limit 10
Traceback (most recent call last):
File "tgmount.py", line 168, in <module>
loop.run_until_complete(main())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "tgmount.py", line 59, in main
await list_documents(await client(),
File "/home/media/tgmount/tgmount/tgmount/actions.py", line 39, in list_documents
entity = await client.get_entity(id)
File "/home/media/.local/lib/python3.8/site-packages/telethon/client/users.py", line 292, in get_entity
inputs.append(await self.get_input_entity(x))
File "/home/media/.local/lib/python3.8/site-packages/telethon/client/users.py", line 466, in get_input_entity
raise ValueError(
ValueError: Could not find the input entity for PeerUser(user_id=793392913) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.
I cannot really say when it happens, but it happens.
The same file downloads with errors and then after some time - correctly.
I can hear it in music player, it looks like it downloads the same file part or chunk two times and returns it twice.
Eg. I'm listening to music and after some time there's glitched part: It plays again the same part of track second time or skips some fragment (very short, fraction of second, but disturbing).
When I listen close player and play this track again, there's no glitch anymore.
Hi,
I tried logging in as bot, when I found out that there's no way, I tried to put already logged in bot session to bot, but it failed:
$ ./tgmount.py --id -1001410674750 --list-documents
Traceback (most recent call last):
File "./tgmount.py", line 209, in <module>
loop.run_until_complete(main())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./tgmount.py", line 70, in main
await list_documents(await client(),
File "/home/juniorjpdj/dev/tgmount/tgmount/tgmount/functions.py", line 50, in list_documents
documents = await client.get_documents(entity,
File "/home/juniorjpdj/dev/tgmount/tgmount/tgmount/tgclient.py", line 313, in get_documents
[messages, documents] = await self._get_documents(entity,
File "/home/juniorjpdj/dev/tgmount/tgmount/tgmount/tgclient.py", line 292, in _get_documents
messages = await self.get_messages(entity, limit=limit, offset_id=offset_id, reverse=reverse,
File "/usr/lib/python3.8/site-packages/telethon/client/messages.py", line 531, in get_messages
return await it.collect()
File "/usr/lib/python3.8/site-packages/telethon/requestiter.py", line 113, in collect
async for message in self:
File "/usr/lib/python3.8/site-packages/telethon/requestiter.py", line 74, in __anext__
if await self._load_next_chunk():
File "/usr/lib/python3.8/site-packages/telethon/client/messages.py", line 165, in _load_next_chunk
r = await self.client(self.request)
File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "/usr/lib/python3.8/site-packages/telethon/client/users.py", line 77, in _call
result = await future
telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by SearchRequest)
Also when I tried to mount:
./tgmount.py --id -1001410674750 --mount ./dir --debug --debug-fuse 46.175.44.195 93% ─╯
DEBUG [root] Namespace(all_files=False, debug=True, debug_fuse=True, download=None, files=[], fsname='tgfs', id='-1001410674750', json=False, limit=None, list_dialogs=False, list_documents=False, mount='./dir', no_updates=False, offset_id=0, reverse=False, session='tgfs', socks=None)
DEBUG [tgclient] Connecting to Telegram servers...
INFO [telethon.network.mtprotosender] Connecting to 149.154.167.92:443/TcpFull...
INFO [telethon.network.mtprotosender] Connection to 149.154.167.92:443/TcpFull complete!
DEBUG [tgclient] Connected
DEBUG [pyfuse3] Calling fuse_session_unmount
[1] 143926 segmentation fault (core dumped) ./tgmount.py --id -1001410674750 --mount ./dir --debug --debug-fuse
Hi!
I'm trying to automate detection of new files posted on group I mounted.
The problem is your filenames are not consistent.
tgmount/tgmount/tgmount/dclasses.py
Lines 40 to 46 in b654d70
Eg. I'd like to mount only music and document files, but I got stickers, photos and voice messages ;/
$ python3 tgmount.py --download /tmp/files/ --id blahblah --files 17525,17526
INFO [root] Download files [17525, 17526] from blahblah to /tmp/files/
Traceback (most recent call last):
File "tgmount.py", line 168, in <module>
loop.run_until_complete(main())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "tgmount.py", line 81, in main
await download(await client(),
File "/home/media/tgmount/tgmount/tgmount/actions.py", line 156, in download
([d['attributes']['file_name'] for m, d in documents],))
File "/home/media/tgmount/tgmount/tgmount/actions.py", line 156, in <listcomp>
([d['attributes']['file_name'] for m, d in documents],))
TypeError: 'Message' object is not subscriptable
Me and my friends are sharing music with each other, but when we share albums - those are ZIPed.
What if your filesystem could mount those ZIP files as directories in filesystem?
There's very easy to use Zipfile lib in python stdlib.
It's needed now as users can have >32b userids
$ cp flaczkownia/66556\ DJ\ Wielki\ Huj\ -\ Halloween\ EP\ 2\ \(2018\).zip .
cp: error reading 'flaczkownia/66556 DJ Wielki Huj - Halloween EP 2 (2018).zip': Input/output error
Could you add a way to retry on timeout and make retries amount configurable?
I can't use it right now as it breaks everything when telegram is lagging a bit.
I'm having weird problem.
Everything works at least good at start and few hours later, but at some moment reads just block.
No network activity is observed after file open, read of old files is just stuck. New files are working good.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.