Skip to content

Instantly share code, notes, and snippets.

View Daniel-Worrall's full-sized avatar

Daniel Worrall Daniel-Worrall

View GitHub Profile
@Daniel-Worrall
Daniel-Worrall / twist.moe.cr
Created June 21, 2020 02:12
Unencryption for video links on twist.moe
require "openssl"
data = ""
KEY = "LXgIVP&PorO68Rq7dTx8N^lP!Fa5sGJ^*XK"
cipher = OpenSSL::Cipher.new("aes-256-cbc")
encrypted = Base64.decode_string(data)
salt = encrypted.to_slice[8, 8]
my_data = KEY + String.new(salt)
@Daniel-Worrall
Daniel-Worrall / download.cr
Created June 21, 2020 04:00
twist.moe Downloader Crystal
require "./twist"
CHUNK_SIZE = 1024
name = ""
path = ""
Dir.mkdir_p(path)
Twist.get_sources(name).each do |source|
filename = "#{path}/#{name} E#{source.number.to_s.rjust(2, '0')}.mp4"
@Daniel-Worrall
Daniel-Worrall / sieve.cr
Last active March 22, 2022 22:53
Factorisation Sieve
module Sieve
protected class_getter sieve = Hash(Int32, Int32).new { |h, k| k }
@@calculated = 1
class Factors
include Iterator(Int32)
def initialize(@n : Int32)
end