Skip to content

Instantly share code, notes, and snippets.

View painor's full-sized avatar

painor painor

  • TopCode Softwares
  • Tunisia
View GitHub Profile
@painor
painor / README.MD
Last active March 26, 2024 04:50
Convert TDesktop tdata folders to GramJS sessions.

tdata converter

Converts tdata folder to a GramJS session for usage in a userbot.

Usage

Usage is simple. the main() function accepts a folder path (absolute or relative) and will return and print the session string if it found one.

Limitation

@painor
painor / FastTelethon.py
Last active April 26, 2024 01:36
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO