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 socket import socket | |
from threading import Thread | |
from message import MessageParser, MessageBuffer | |
class Socket(socket): | |
def __init__(self, address, port): | |
socket.__init__(self) | |
self.connect((address, port)) | |
class IRCMessageLoop(Thread): |
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.tl.types import MessageEntityMention | |
def getMentionEntities(message): | |
mentions = [] | |
for entity in message.entities: | |
if type(entity) is MessageEntityMention: | |
offset = entity.offset | |
length = entity.length | |
mentions.append(message.message[offset:offset + length]) | |
return mentions |
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
# Added bool detection. | |
# Added serialization. | |
class Metadata: | |
def __new__(type_, data): | |
if type(data) == dict: | |
return super().__new__(type_) | |
if type(data) is list: | |
items = [] |
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 os | |
import sys | |
import shutil | |
# Sub types. | |
SubTypes = ['.srt'] | |
# Video types. | |
VideoTypes = ['.mp4', '.avi', '.mkv'] |
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, events | |
lt = 1532541774 | |
rtBaseUrl = "https://t.me/rtnews/" | |
# Automatic Message Forwarder For RT | |
async def messageHandlerForRT(event): | |
# Ignore single messages, part of a group. | |
if type(event) == events.newmessage.NewMessage.Event and event.message.grouped_id: | |
return |
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
#include "stdio.h" | |
#include "windows.h" | |
void sendContrlKey(int vKeyCode) { | |
INPUT inputs[4]; | |
ZeroMemory(inputs, sizeof(inputs)); | |
inputs[0].type = INPUT_KEYBOARD; | |
inputs[0].ki.wVk = VK_CONTROL; | |
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 requests | |
import json | |
import yaml | |
basePath = "https://www.googleapis.com/youtube/v3" | |
class YTChannelFeed: | |
def __init__(self, channelId): | |
self.config = yaml.safe_load(open("feeds/config.yaml")) | |
self.channelId = channelId |
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 urllib.request | |
import urllib.error | |
import urllib.parse | |
import os, bs4, json, yaml, feedparser | |
def updateChannel(channelUrl): | |
res = urllib.request.urlopen(channelUrl) | |
soup = bs4.BeautifulSoup(res.read(), features="html.parser") | |
for child in soup.html.body.children: |
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
- | |
hash: 6881d96b7604bd046e3b19e9b50ef48b | |
char: who knows | |
- | |
hash: 3bcb9bef89eef4dbd26935711a592020 | |
char: Alice Zuberg | |
anime: Sword Art Online | |
- | |
hash: 4a7cbec6f436a8faedbb6b3e3f5a5091 | |
char: Fuyumi Irisu |
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
subs = SubtitleFile("the grudge.srt") | |
subs.delay(-1000) | |
subs.save("new subs.srt") |