This file contains hidden or 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
server { | |
listen 443 ssl; | |
server_name domain.com; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; | |
# First Entry | |
location /VAR1/ { | |
proxy_pass http://127.0.0.1:VAR2/; |
This file contains hidden or 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 telethon import TelegramClient | |
from telethon.errors import SessionPasswordNeededError | |
from telethon.tl.functions.messages import GetHistoryRequest | |
from telethon.tl.functions.channels import DeleteMessagesRequest | |
from telethon.tl.types.channel import Channel | |
import shelve | |
from os import listdir | |
from time import sleep | |
# Просто утилиты |
This file contains hidden or 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
{'animation': {'file_id': None, | |
'file_name': 'animation.gif.mp4', | |
'file_size': 192239, | |
'mime_type': 'video/mp4', |
This file contains hidden or 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 moviepy.editor import * | |
# import telebot | |
# import threading | |
# ...receive message with link to .webm... | |
def convert_webm_to_mp4(message, m): | |
video = VideoFileClip(m.group(0)) | |
converting = bot.reply_to(message, '<i>Конвертирую...</i>', parse_mode='HTML') | |
bot.send_chat_action(message.chat.id, 'upload_video') |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import requests | |
s = requests.session() | |
URL = 'https://2ch.hk/' | |
BOARD = 'test' | |
THREAD = '31942' |
This file contains hidden or 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 telethon import TelegramClient | |
from telethon.tl.functions.messages import GetFullChatRequest | |
api_id = 12345 # my.telegram.org | |
api_hash = 'n91hds91hd90qwd' # credenitals | |
phone_number = '+1231241213' | |
client = TelegramClient('telegram_script', api_id, api_hash) # feel free to edit %sessionname% as you want | |
client.connect() # logining and connecting to Telegram servers |
This file contains hidden or 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
if blocked.contains(users.ID == str(message.new_chat_member.id)): | |
bot.kick_chat_member(message.chat.id, message.new_chat_member.id) | |
bot.send_message(message.chat.id, '`' + message.new_chat_member.first_name + '`' + ' was blocked', | |
parse_mode='Markdown') | |
bot.send_message(me, '`' + message.new_chat_member.first_name + '`' + ' #id' + str( | |
message.new_chat_member.id) + ' was banned because of *BLOCK* in #{}'.format(message.chat.username), | |
parse_mode='Markdown') | |
blocked.remove(eids=[blocked.get(users.ID == str(message.new_chat_member.id)).eid]) |
This file contains hidden or 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 telebot | |
token = '123456789:AAAbbbCccDDDEEEffFGGgHHhIIijjJ12345' | |
bot = telebot.TeleBot(token) | |
@bot.channel_post_handler(content_types=['video_note']) | |
def converting(message): | |
bot.get_file(message.video_note.file_id) | |
videonote = bot.download_file(bot.get_file(message.video_note.file_id).file_path) |
This file contains hidden or 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 telethon import TelegramClient | |
from telethon.tl.functions.channels import GetParticipantsRequest | |
from telethon.tl.types import ChannelParticipantsRecent | |
from telethon.utils import get_input_peer | |
api_id = 123456 # Use your own values here. https://my.telegram.org | |
api_hash = '0123456789abcdef0123456789abcdef' | |
phone_number = '+34600000000' | |
client = TelegramClient('%sessionname%', api_id, api_hash) # feel free to edit %sessionname% as you want |
This file contains hidden or 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 telebot | |
import wget | |
token = '123456789:AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLL' | |
chatid = 12345678 | |
bot = telebot.TeleBot(token) | |
file = 'http://dictionary.cambridge.org/media/english/uk_pron_ogg/u/ukh/ukhef/ukheft_029.ogg' | |
file = wget.download(file) | |
file = open(file, 'rb') |