Skip to content

Instantly share code, notes, and snippets.

View Emzi0767's full-sized avatar

Mateusz Brawański Emzi0767

View GitHub Profile
@Emzi0767
Emzi0767 / avset.py
Last active May 17, 2017 20:40
Overly fancy avatar update script, based on d.py
import asyncio
import discord
import argparse
class AvatarClient(discord.Client):
def __init__(self, token: str, filename: str, username: str):
super().__init__()
self._av_token = token
self._av_filename = filename
@Emzi0767
Emzi0767 / NativeGlue.cs
Last active April 5, 2017 11:23
Unmanaged glue for Discord.NET
using System;
using System.Runtime.InteropServices;
using Discord;
using Discord.WebSocket;
namespace Emzi0767.GluedEval
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void SendMessageDelegate(ulong channel, string msg, IntPtr embed);
@Emzi0767
Emzi0767 / YtAudio.cs
Last active June 4, 2021 09:12
YouTube audio stream url extractor
// requires Jint
//
// this can be used for video streams as well, with few modifications
public async Task<string> GetYtAudioUrl(string id)
{
await Task.Yield();
var utf8 = new UTF8Encoding(false);
var wc = new WebClient();
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
namespace eMZi.Gaming.Minecraft
{