Skip to content

Instantly share code, notes, and snippets.

View muhammedfurkan's full-sized avatar
🙃

M.Furkan muhammedfurkan

🙃
View GitHub Profile
import aioschedule as schedule
import asyncio
from telethon import TelegramClient
with TelegramClient(
os.path.abspath(fileName),
config.getint("api", "api_id"),
config.get("api", "api_hash"),
connection_retries=15,
retry_delay=3,
@muhammedfurkan
muhammedfurkan / autoreplier.py
Created April 25, 2020 20:20 — forked from yi-jiayu/autoreplier.py
Automatic replies for Telegram (Updated for Telethon 1.6.2)
import time
from telethon import TelegramClient, events
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220
# or use your own
api_id = 17349
api_hash = '344583e45741c457fe1862106095a5eb'
# fill in your own details here
@muhammedfurkan
muhammedfurkan / call.py
Created April 25, 2020 20:21 — forked from painor/call.py
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
@muhammedfurkan
muhammedfurkan / split.py
Created April 25, 2020 20:22 — forked from behf/split.py
split a long text into small chunks, it won't cut your words.
def split_message(text, length=4096, offset=200):
return [text[text.find('\n', i - offset, i + 1) if text.find('\n', i - offset, i + 1) != -1 else i:
text.find('\n', i + length - offset, i + length) if text.find('\n', i + length - offset,
i + length) != -1 else i + length] for
i
in
range(0, len(text), length)]
# Usage, Using Pyrogram
@muhammedfurkan
muhammedfurkan / FastTelethon.py
Created April 28, 2022 08:22 — forked from painor/FastTelethon.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
if (sys.version_info < (3, 0)):
# Python 3 code in this block
print('Python v3.5 or above required for Instaloader module at the moment. Exiting...')
quit()
@muhammedfurkan
muhammedfurkan / js-turkish-to-english.js
Created June 17, 2022 08:09 — forked from enginkartal/js-turkish-to-english.js
Javascript Turkish character to english characters change
String.prototype.turkishtoEnglish = function () {
return this.replace('Ğ','g')
.replace('Ü','u')
.replace('Ş','s')
.replace('I','i')
.replace('İ','i')
.replace('Ö','o')
.replace('Ç','c')
.replace('ğ','g')
.replace('ü','u')
@muhammedfurkan
muhammedfurkan / example.com
Created September 26, 2022 06:39
NGINX installation with Let's Encrypt
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name example.com;
include /etc/nginx/mime.types;
}
server {
if ($host = example.com) {
@muhammedfurkan
muhammedfurkan / AUTO_DEPLOY.md
Created November 3, 2022 07:26 — forked from zihadmahiuddin/AUTO_DEPLOY.md
GitHub Auto Deploy for NodeJS apps using Webhooks
@muhammedfurkan
muhammedfurkan / AES-CBC-PKCS5PADDING.md
Created February 1, 2023 06:52 — forked from kcak11/0000.md
AES/CBC/PKCS5PADDING - Java/Javascript (Encryption & Decryption)

AES/CBC/PKCS5PADDING - Java/Javascript (Encryption & Decryption)