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 / unmarshal.py
Last active October 14, 2023 11:04
unmarshal python code object string. python2
import marshal
a = marshal.loads("your marshal string data that is a code object here")
import py_compile
import time
import uncompyle6
@painor
painor / FastTelethon.py
Last active April 27, 2024 16:21
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
@painor
painor / call.py
Created February 2, 2019 00:55
Make a call using pyrogram
#This is taken from https://github.com/LonamiWebs/Telethon-calls/blob/master/calls.py and modified
import hashlib
import os
import random
from pyrogram import Client
from pyrogram.api.functions.messages import GetDhConfig
from pyrogram.api.functions.phone import RequestCall
from pyrogram.api.types import PhoneCallProtocol