This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time as tm | |
spams = {} | |
msgs = 4 # Messages in | |
max = 5 # Seconds | |
ban = 300 # Seconds | |
def is_spam(user_id): | |
try: | |
usr = spams[user_id] | |
usr["messages"] += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import random | |
import pickle | |
from redis import StrictRedis | |
def random_id(lenght=8, letters=string.ascii_letters + string.digits): | |
return "".join(random.choice(letters) for _ in range(lenght)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @property string | |
*/ | |
function encr($raw) { | |
$encoded = ""; | |
$seprated = str_split(base64_encode($raw)); | |
$empty = []; | |
while (count($seprated) > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import json | |
import base64 | |
from Crypto.Cipher import AES as _AES | |
import random | |
class AES(object): | |
def __init__(self, key="KCH@LQj#>6VCqqLg", iv="YC'2bmK=b%#NQ?9j"): | |
self.bs = 16 | |
self.cipher = _AES.new(key, _AES.MODE_CBC, iv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: amirsbss | |
* Date: 11/3/18 | |
* Time: 1:08 AM | |
*/ | |
define('BOT_TOKEN', 'TOKEN'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function multipartFormData($data=[], $files=[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ffmpeg import * | |
def progress(duration, time, process_name): | |
print(f"{time} from {duration} seconds is fixed, Process name: {process_name}") | |
def streamable(input_file, output_file): | |
args = ['-movflags', 'faststart', '-strict', '-2'] | |
return ffmpeg(input_file, output_file, args, progress, ["Test Progress!"]) | |
# You can run this in a thread | |
streamable("input.mp4", "output.mp4") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# DOCS: https://idpay.ir/web-service/v1.1/index.html | |
class IDPay: | |
API_URL = "https://api.idpay.ir/v1.1/payment" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib import parse | |
import string | |
import base64 | |
import traceback | |
def validate(proxy_link): | |
try: | |
if proxy_link.startswith("tg://proxy") or proxy_link.replace("https://", "").startswith("t.me/proxy"): | |
args = dict(parse.parse_qsl(parse.urlsplit(proxy_link).query)) | |
if args.get("server") and args.get("port") and args.get("secret"): |