MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / __init__

Method __init__

TechVJ/utils/custom_dl.py:21–39  ·  view source on GitHub ↗

A custom class that holds the cache of a specific client and class functions. attributes: client: the client that the cache is for. cached_file_ids: a dict of cached file IDs. cached_file_properties: a dict of cached file properties. funct

(self, client: Client)

Source from the content-addressed store, hash-verified

19
20class ByteStreamer:
21 def __init__(self, client: Client):
22 """A custom class that holds the cache of a specific client and class functions.
23 attributes:
24 client: the client that the cache is for.
25 cached_file_ids: a dict of cached file IDs.
26 cached_file_properties: a dict of cached file properties.
27
28 functions:
29 generate_file_properties: returns the properties for a media of a specific message contained in Tuple.
30 generate_media_session: returns the media session for the DC that contains the media file.
31 yield_file: yield a file from telegram servers for streaming.
32
33 This is a modified version of the <https://github.com/eyaadh/megadlbot_oss/blob/master/mega/telegram/utils/custom_download.py>
34 Thanks to Eyaadh <https://github.com/eyaadh>
35 """
36 self.clean_timer = 30 * 60
37 self.client: Client = client
38 self.cached_file_ids: Dict[int, FileId] = {}
39 asyncio.create_task(self.clean_cache())
40
41 async def get_file_properties(self, id: int) -> FileId:
42 """

Callers

nothing calls this directly

Calls 1

clean_cacheMethod · 0.95

Tested by

no test coverage detected